Skip to content

Commit

Permalink
t
Browse files Browse the repository at this point in the history
  • Loading branch information
mcdee committed Aug 20, 2023
1 parent 1f1ddc1 commit f1a1d4f
Showing 1 changed file with 47 additions and 2 deletions.
49 changes: 47 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,9 @@ jobs:
asset_name: ${{ needs.env_vars.outputs.binary }}-${{ needs.env_vars.outputs.release_version }}-linux-arm64.tar.gz.sha256
asset_content_type: text/plain

# Build and pack the binaries for OSX.
# Build and pack the X64 binaries for OSX.
build_macos:
runs-on: macos-latest
runs-on: [ macos-latest, x64]
needs: [create_release, env_vars]
steps:
- name: Set up Go
Expand Down Expand Up @@ -158,6 +158,51 @@ jobs:
asset_name: ${{ needs.env_vars.outputs.binary }}-${{ needs.env_vars.outputs.release_version }}-darwin-amd64.tar.gz.sha256
asset_content_type: text/plain

# Build and pack the ARM64 binaries for OSX.
build_macos:
runs-on: [ macos-latest, ARM64]
needs: [create_release, env_vars]
steps:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: '^1.20'

- name: Check out repository into the Go module directory
uses: actions/checkout@v3

- name: Select correct tag
run: git checkout ${{ github.ref_name }}

- name: Fetch repository dependencies
run: go get -v -t ./...

- name: Compile
run: |
go build -tags osusergo,netgo -v -ldflags="-X github.com/${{ github.repository }}/cmd.ReleaseVersion=${{ needs.env_vars.outputs.release_version }}"
tar zcf ${{ needs.env_vars.outputs.binary }}-${{ needs.env_vars.outputs.release_version }}-darwin-arm64.tar.gz ${{ needs.env_vars.outputs.binary }}
brew install coreutils
sha256sum ${{ needs.env_vars.outputs.binary }}-${{ needs.env_vars.outputs.release_version }}-darwin-arm64.tar.gz | sed -e 's/ .*//' >${{ needs.env_vars.outputs.binary }}-${{ needs.env_vars.outputs.release_version }}-darwin-arm64.tar.gz.sha256
- name: Upload binary
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ needs.create_release.outputs.upload_url }}
asset_path: ./${{ needs.env_vars.outputs.binary }}-${{ needs.env_vars.outputs.release_version }}-darwin-arm64.tar.gz
asset_name: ${{ needs.env_vars.outputs.binary }}-${{ needs.env_vars.outputs.release_version }}-darwin-arm64.tar.gz
asset_content_type: application/octet-stream

- name: Upload hash
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ needs.create_release.outputs.upload_url }}
asset_path: ./${{ needs.env_vars.outputs.binary }}-${{ needs.env_vars.outputs.release_version }}-darwin-arm64.tar.gz.sha256
asset_name: ${{ needs.env_vars.outputs.binary }}-${{ needs.env_vars.outputs.release_version }}-darwin-arm64.tar.gz.sha256
asset_content_type: text/plain

# Build and pack the binaries for Windows.
build_windows:
runs-on: windows-latest
Expand Down

0 comments on commit f1a1d4f

Please sign in to comment.