Skip to content

Commit

Permalink
pull binaries from homebrew bottle
Browse files Browse the repository at this point in the history
  • Loading branch information
wasaga committed Nov 24, 2022
1 parent 9fba31d commit 4a2d8f9
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 84 deletions.
27 changes: 3 additions & 24 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,44 +10,23 @@ jobs:
osx:
runs-on: macos-latest
steps:
- uses: maxim-lobanov/setup-xcode@9a697e2b393340c3cacd97468baa318e4c883d98
with:
xcode-version: 14.1
- name: envoy deps
run: |
brew install automake bazelisk cmake coreutils libtool ninja
- name: Get tag name
id: tagName
run: |
TAG=${GITHUB_REF##*/}
echo ::set-output name=tag::${TAG}
- name: checkout envoy
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8
with:
repository: envoyproxy/envoy
ref: ${{ steps.tagName.outputs.tag }}

- name: build
run: |
bazelisk build \
--curses=no \
--verbose_failures \
--action_env=PATH=/usr/local/bin:/opt/local/bin:/usr/bin:/bin:$PATH \
-c "opt" //source/exe:envoy-static --config=sizeopt
mv bazel-bin/source/exe/envoy-static envoy-darwin-amd64
brew install oras
- name: shasum
run: |
shasum -a 256 envoy-darwin-amd64 > envoy-darwin-amd64.sha256
sh ./mac.sh ${{ steps.tagName.outputs.tag }}
- name: Upload artifacts to release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release -R pomerium/envoy-binaries upload ${{ steps.tagName.outputs.tag }} envoy-*
gh release -R pomerium/envoy-binaries upload ${{ steps.tagName.outputs.tag }} envoy-darwin-*
linux:
runs-on: ubuntu-latest
Expand Down
26 changes: 0 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,29 +11,3 @@ This repo contains:

When a release tag is created, the envoy binaries will be automatically extracted from the matching `envoyproxy/envoy` image tag and uploaded to the release.

# Building Envoy for darwin/arm64

Currently there's no way to run a github action on darwin/arm64, so the build must be done manually:

1. Clone envoyproxy/envoy
```bash
git clone [email protected]:envoyproxy/envoy
```
1. Checkout the release tag
```bash
git checkout v1.23.0
```
1. Build
```bash
bazelisk build -c "opt" //source/exe:envoy-static --config=sizeopt
```
1. Wait a **very** long time.
1. Copy binary
```bash
cp -f bazel-bin/source/exe/envoy-static ~/Downloads/envoy-darwin-arm64
```
1. Produce shasum
```bash
shasum -a 256 ~/Downloads/envoy-darwin-arm64 > ~/Downloads/envoy-darwin-arm64.sha256
```
1. Drag & Drop the files to the release
34 changes: 0 additions & 34 deletions arm.md

This file was deleted.

33 changes: 33 additions & 0 deletions mac.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/bin/sh
# downloads a MacOS Envoy from homebrew
# takes `v1.x.y` as an argument

set -e

if [ $# -eq 0 ]; then
echo "expected an envoy version"
exit 1
fi

# homebrew doesn't use v, just a number triplet
_version=${1:1}

# AMD64 is not supported beyond 12.6
oras pull ghcr.io/homebrew/core/envoy:${_version} --platform "darwin/amd64:macOS 12.6"
tar --extract \
--file envoy--${_version}.monterey.bottle.tar.gz \
--directory . \
--strip-components=3 \
envoy/${_version}/bin/envoy
mv -f envoy envoy-darwin-amd64

oras pull ghcr.io/homebrew/core/envoy:${_version} --platform "darwin/arm64:macOS 13"
tar --extract \
--file envoy--${_version}.arm64_ventura.bottle.tar.gz \
--directory . \
--strip-components=3 \
envoy/${_version}/bin/envoy
mv -f envoy envoy-darwin-arm64

shasum -a 256 envoy-darwin-amd64 > envoy-darwin-amd64.sha256
shasum -a 256 envoy-darwin-arm64 > envoy-darwin-arm64.sha256

0 comments on commit 4a2d8f9

Please sign in to comment.