Skip to content

Commit

Permalink
feat(cd): support macos aarch64 binary
Browse files Browse the repository at this point in the history
  • Loading branch information
EstebanBorai committed Jun 6, 2024
1 parent 9674efa commit 1c062c7
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 58 deletions.
63 changes: 37 additions & 26 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,37 +89,48 @@ jobs:
strategy:
matrix:
name:
- linux
- macos
- windows
include:
- name: linux
os: ubuntu-latest
artifact_name: wait-on
asset_name: wait-on

- name: macos
os: macos-latest
artifact_name: wait-on
asset_name: wait-on

- name: windows
os: windows-latest
artifact_name: wait-on
asset_name: wait-on.exe
- linux-x64-musl
- macos-x64
- macos-aarch64

include:
- name: linux-x64-musl
os: ubuntu-latest
target: x86_64-unknown-linux-musl
exe: wait-on

- name: macos-x64
os: macos-latest
target: x86_64-apple-darwin
exe: wait-on

- name: macos-aarch64
os: macos-latest
target: aarch64-apple-darwin
exe: wait-on

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}

- name: Upload release artifacts
uses: actions/github-script@v5
env:
ARTIFACT_NAME: ${{ matrix.artifact_name }}
ASSET_NAME: ${{ matrix.asset_name }}
- name: Build for Release
run: cargo build --release --target ${{ matrix.target }}

- name: Prepare Binary
shell: bash
run: |
chmod +x ./target/${{ matrix.target }}/release/${{ matrix.exe }}
cp ./target/${{ matrix.target }}/release/${{ matrix.exe }} ./${{ matrix.exe }}
- name: Attach Binary
uses: svenstaro/upload-release-action@2.9.0
with:
script: |
const script = require('./.github/workflows/scripts/upload-artifacts.js');
console.log(script({ github, context }));
asset_name: wait-on-${{ matrix.target }}
file: ${{ matrix.exe }}
repo_token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.ref }}
32 changes: 0 additions & 32 deletions .github/workflows/scripts/upload-artifacts.js

This file was deleted.

0 comments on commit 1c062c7

Please sign in to comment.