-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add release for macOS apple silicon (#39)
* add macOS-apple-silicon release * fix target * add build comment * actions/checkout v4 * differentiate apple and intel executables
- Loading branch information
Showing
1 changed file
with
50 additions
and
6 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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: | ||
|
@@ -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 | ||
|
||
|
@@ -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: | ||
|