Skip to content

Commit

Permalink
Merge pull request #11 from yukukotani/macos
Browse files Browse the repository at this point in the history
Publish the build for MacOS
  • Loading branch information
m-mizutani authored Jun 13, 2024
2 parents f48a2a4 + 9bd1352 commit f0c8abf
Showing 1 changed file with 43 additions and 8 deletions.
51 changes: 43 additions & 8 deletions .github/workflows/reelase.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,53 @@ permissions:
packages: write

jobs:
releases-matrix:
name: Release Go Binary
releases-linux:
name: Release Go Binary for Linux
runs-on: ubuntu-latest
strategy:
matrix:
# keychain library is required for building darwin binary, however it's not available in ubuntu. Then we build only linux binary here.
goos: [linux]
goarch: [amd64, arm64]
env:
goos: linux
steps:
- uses: actions/checkout@v4
- uses: wangyoucao577/go-release-action@v1
- uses: actions/setup-go@v5
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
goos: ${{ matrix.goos }}
goarch: ${{ matrix.goarch }}
go-version: "stable"
- name: Build
run: go build
env:
GOOS: ${{ env.goos }}
GOARCH: ${{ matrix.goarch }}
- name: Compress
run: tar -zcvf zenv-${{ github.event.release.tag_name }}-${{ env.goos }}-${{ matrix.goarch }}.tar.gz zenv
- uses: shogo82148/actions-upload-release-asset@v1
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: zenv-${{ github.event.release.tag_name }}-${{ env.goos }}-${{ matrix.goarch }}.tar.gz

releases-macos:
name: Release Go Binary for MacOS
runs-on: macos-latest
strategy:
matrix:
goarch: [amd64, arm64]
env:
goos: darwin
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: "stable"
- name: Build
run: go build
env:
GOOS: ${{ env.goos }}
GOARCH: ${{ matrix.goarch }}
CGO_ENABLED: 1
- name: Compress
run: tar -zcvf zenv-${{ github.event.release.tag_name }}-${{ env.goos }}-${{ matrix.goarch }}.tar.gz zenv
- uses: shogo82148/actions-upload-release-asset@v1
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: zenv-${{ github.event.release.tag_name }}-${{ env.goos }}-${{ matrix.goarch }}.tar.gz

0 comments on commit f0c8abf

Please sign in to comment.