Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add release for macOS apple silicon #39

Merged
merged 5 commits into from
Sep 16, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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/get-tag@v2.1.2
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