Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pull binaries from homebrew bottle #25

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 24 additions & 23 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,44 +10,45 @@ 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

# homebrew doesn't use v, just a number triplet
_version=${{ steps.tagName.outputs.tag }}
_version=${_version: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

- name: shasum
run: |
shasum -a 256 envoy-darwin-amd64 > envoy-darwin-amd64.sha256
shasum -a 256 envoy-darwin-arm64 > envoy-darwin-arm64.sha256

- 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