Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: | |
release: | |
types: [created] | |
jobs: | |
release: | |
name: release ${{ matrix.target }} | |
runs-on: macos-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- target: x86_64-apple-darwin | |
archive: tar.gz tar.xz | |
- target: aarch64-apple-darwin | |
archive: tar.gz tar.xz | |
steps: | |
- uses: actions/checkout@master | |
- uses: actions/setup-go@v3 | |
- name: Running go build for ${{ matrix.target }} | |
if: matrix.target == 'x86_64-apple-darwin' | |
run: go build -o bin/mada | |
- name: Running go build for ${{ matrix.target }} | |
if: matrix.target == 'aarch64-apple-darwin' | |
run: GOOS=darwin GOARCH=arm64 CGO_ENABLED=1 SDKROOT=$(xcrun --sdk macosx --show-sdk-path) go build -o bin/mada | |
- name: Set env | |
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV | |
- name: Packaging final binary | |
shell: bash | |
run: | | |
tar czvf mada_${{ env.RELEASE_VERSION }}_${{ matrix.target }}.tar.gz bin/mada | |
shasum -a 256 mada_${{ env.RELEASE_VERSION }}_${{ matrix.target }}.tar.gz > mada_${{ env.RELEASE_VERSION }}_${{ matrix.target }}.tar.gz.sha256 | |
- name: Releasing assets | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: | | |
mada_${{ env.RELEASE_VERSION }}_${{ matrix.target }}.tar.gz | |
mada_${{ env.RELEASE_VERSION }}_${{ matrix.target }}.tar.gz.sha256 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |