Skip to content

Commit

Permalink
Add release for macOS apple silicon (#39)
Browse files Browse the repository at this point in the history
* add macOS-apple-silicon release

* fix target

* add build comment

* actions/checkout v4

* differentiate apple and intel executables
  • Loading branch information
ameknite authored Sep 16, 2023
1 parent 12f4299 commit 46eac4a
Showing 1 changed file with 50 additions and 6 deletions.
56 changes: 50 additions & 6 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,8 @@ jobs:
tag: ${{ github.ref }}
overwrite: true

# Build for macOS
release-macos:
# Build for MacOS x86_64
release-macOS-intel:
runs-on: macOS-latest

steps:
Expand Down Expand Up @@ -177,16 +177,59 @@ jobs:
- name: Upload binaries to artifacts
uses: actions/upload-artifact@v3
with:
path: ${{ env.binary }}.dmg
name: mac
path: ${{ env.binary }}-intel.dmg
name: macOS-intel

- name: Upload binaries to release
if: ${{ env.add_binaries_to_github_release == 'true' }}
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ${{ env.binary }}.dmg
asset_name: ${{ env.binary }}-macos-${{ steps.get_version.outputs.tag }}.dmg
asset_name: ${{ env.binary }}-macOS-intel-${{ steps.get_version.outputs.tag }}.dmg
tag: ${{ github.ref }}
overwrite: true

# Build for MacOS Apple Silicon
release-macOS-apple-silicon:
runs-on: macOS-latest

steps:
- uses: olegtarasov/[email protected]
id: get_version
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
targets: aarch64-apple-darwin
- name: Environment
# macOS 11 was the first version to support ARM
run: |
export MACOSX_DEPLOYMENT_TARGET="11"
- name: Build
run: |
cargo build --release --target aarch64-apple-darwin
- name: Prepare Package
run: |
mkdir -p ${{ env.binary }}.app/Contents/MacOS
cp target/aarch64-apple-darwin/release/${{ env.binary }} ${{ env.binary }}.app/Contents/MacOS/
cp -r assets ${{ env.binary }}.app/Contents/MacOS/
hdiutil create -fs HFS+ -volname "${{ env.binary }}" -srcfolder ${{ env.binary }}.app ${{ env.binary }}.dmg
- name: Upload binaries to artifacts
uses: actions/upload-artifact@v3
with:
path: ${{ env.binary }}.dmg
name: macOS-apple-silicon

- name: Upload binaries to release
if: ${{ env.add_binaries_to_github_release == 'true' }}
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ${{ env.binary }}-apple-silicon.dmg
asset_name: ${{ env.binary }}-macOS-apple-silicon-${{ steps.get_version.outputs.tag }}.dmg
tag: ${{ github.ref }}
overwrite: true

Expand All @@ -210,7 +253,8 @@ jobs:
- release-wasm
- release-linux
- release-windows
- release-macos
- release-macOS-intel
- release-macOS-apple-silicon
if: ${{ needs.check-if-upload-to-itch-is-configured.outputs.should-upload == 'yes' }}

steps:
Expand Down

0 comments on commit 46eac4a

Please sign in to comment.