Skip to content

Commit b6b9a2d

Browse files
authored
Merge pull request #167 from SuperDude88/actions-updates
Add ARM MacOS Builds to Actions
2 parents 981180a + 420caa7 commit b6b9a2d

File tree

4 files changed

+125
-12
lines changed

4 files changed

+125
-12
lines changed

.github/workflows/build_latest.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,8 @@ jobs:
1111
build-wiiu:
1212
uses: ./.github/workflows/build_wiiu.yml
1313

14-
build-mac:
15-
uses: ./.github/workflows/build_mac.yml
14+
build-mac-x64:
15+
uses: ./.github/workflows/build_mac_x64.yml
16+
17+
build-mac-arm:
18+
uses: ./.github/workflows/build_mac_arm.yml
Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
name: Build - Mac (ARM)
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
build_type:
7+
description: 'Build Type'
8+
default: "Debug"
9+
required: false
10+
type: string
11+
workflow_call:
12+
inputs:
13+
version:
14+
description: 'Version'
15+
default: ''
16+
required: false
17+
type: string
18+
build_type:
19+
description: 'Build Type'
20+
default: "Debug"
21+
required: false
22+
type: string
23+
secrets:
24+
SEED_KEY:
25+
description: 'Key used to complicate the seed string in release builds'
26+
required: false
27+
28+
env:
29+
QT_VERSION: 6.10.1
30+
EXTRA_CMAKE_FLAGS: ""
31+
32+
jobs:
33+
build-desktop-application-mac-arm:
34+
name: Build Desktop Application Mac (ARM)
35+
runs-on: macos-latest
36+
37+
steps:
38+
- name: Checkout Repository
39+
uses: actions/checkout@v6
40+
with:
41+
submodules: recursive
42+
fetch-depth: 0
43+
fetch-tags: true
44+
45+
- name: Install Qt
46+
uses: jurplel/install-qt-action@v4
47+
with:
48+
version: '${{ env.QT_VERSION }}'
49+
host: 'mac'
50+
target: 'desktop'
51+
arch: 'clang_64'
52+
cache: true
53+
54+
- name: Set Debug Flags
55+
if: inputs.build_type == 'Debug'
56+
run: echo "EXTRA_CMAKE_FLAGS=-DENABLE_DEBUG=True ${{ env.EXTRA_CMAKE_FLAGS }}" >> $GITHUB_ENV
57+
58+
- name: Set Release Flags
59+
if: inputs.build_type == 'Release' && inputs.version != ''
60+
run: echo "EXTRA_CMAKE_FLAGS=-DRELEASE_TAG=${{ inputs.version }} ${{ env.EXTRA_CMAKE_FLAGS }}" >> $GITHUB_ENV
61+
62+
- name: Configure CMake
63+
working-directory: ${{ github.workspace }}
64+
env:
65+
SEED_KEY: ${{ secrets.SEED_KEY }}
66+
run: cmake -B build -DGITHUB_WORKFLOW=True -DQT_GUI=True -DEMBED_DATA=True "${{ env.EXTRA_CMAKE_FLAGS }}"
67+
68+
- name: Build
69+
working-directory: ${{ github.workspace }}
70+
run: cmake --build build --config ${{ inputs.build_type }} -j
71+
72+
- name: Call macdeployqt
73+
working-directory: ${{ github.workspace }}/build
74+
run: ../../Qt/${{ env.QT_VERSION }}/macos/bin/macdeployqt wwhd_rando.app
75+
76+
- name: Create DMG
77+
working-directory: ${{ github.workspace }}/build
78+
run: |
79+
mkdir dmg_contents
80+
cp ../gui/desktop/mac_user_instructions.txt ./dmg_contents/READ_THIS_FIRST.txt
81+
cp -R wwhd_rando.app ./dmg_contents/wwhd_rando.app
82+
echo killing...; sudo pkill -9 XProtect >/dev/null || true;
83+
echo waiting...; while pgrep XProtect; do sleep 3; done;
84+
hdiutil create -srcfolder ./dmg_contents wwhd_rando
85+
86+
- name: Get Version
87+
id: get-version
88+
shell: pwsh
89+
working-directory: ${{ github.workspace }}/build
90+
run: |
91+
echo "RANDO_VERSION=$(((Get-Content version.hpp | Select-String -Pattern '#define RANDOMIZER_VERSION "[0-9\.\-a-z]*"') -Replace '.*("[0-9\.\-a-z]*").*', '$1') -Replace '"', '')" >> $env:GITHUB_OUTPUT
92+
93+
- name: Save Artifact
94+
uses: actions/upload-artifact@v6
95+
with:
96+
path: ${{github.workspace}}/build/wwhd_rando.dmg
97+
name: wwhd_rando_${{ steps.get-version.outputs.RANDO_VERSION }}_mac_arm.dmg
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Build - Mac
1+
name: Build - Mac (x64)
22

33
on:
44
workflow_dispatch:
@@ -30,8 +30,8 @@ env:
3030
EXTRA_CMAKE_FLAGS: ""
3131

3232
jobs:
33-
build-desktop-application-mac:
34-
name: Build Desktop Application Mac
33+
build-desktop-application-mac-x64:
34+
name: Build Desktop Application Mac (x64)
3535
runs-on: macos-15-intel
3636

3737
steps:
@@ -94,4 +94,4 @@ jobs:
9494
uses: actions/upload-artifact@v6
9595
with:
9696
path: ${{github.workspace}}/build/wwhd_rando.dmg
97-
name: wwhd_rando_${{ steps.get-version.outputs.RANDO_VERSION }}_mac.dmg
97+
name: wwhd_rando_${{ steps.get-version.outputs.RANDO_VERSION }}_mac_x64.dmg

.github/workflows/build_release.yml

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,16 @@ jobs:
2121
secrets:
2222
SEED_KEY: ${{ secrets.SEED_KEY }}
2323

24-
build-mac:
25-
uses: ./.github/workflows/build_mac.yml
24+
build-mac-x64:
25+
uses: ./.github/workflows/build_mac_x64.yml
26+
with:
27+
version: ${{ github.event.release.tag_name }}
28+
build_type: Release
29+
secrets:
30+
SEED_KEY: ${{ secrets.SEED_KEY }}
31+
32+
build-mac-arm:
33+
uses: ./.github/workflows/build_mac_arm.yml
2634
with:
2735
version: ${{ github.event.release.tag_name }}
2836
build_type: Release
@@ -31,7 +39,7 @@ jobs:
3139

3240
attach-to-release:
3341
name: Attach To Release
34-
needs: [build-windows, build-wiiu, build-mac]
42+
needs: [build-windows, build-wiiu, build-mac-x64, build-mac-arm]
3543
runs-on: ubuntu-latest
3644

3745
steps:
@@ -53,10 +61,15 @@ jobs:
5361
with:
5462
name: wwhd_rando_${{ github.event.release.tag_name }}.wuhb # pass name so it doesn't get put in a folder
5563

56-
- name: Download Mac OS Artifact
64+
- name: Download Mac OS Artifact (x64)
65+
uses: actions/download-artifact@v7
66+
with:
67+
name: wwhd_rando_${{ github.event.release.tag_name }}_mac_x64.dmg # pass name so it doesn't get put in a folder
68+
69+
- name: Download Mac OS Artifact (ARM)
5770
uses: actions/download-artifact@v7
5871
with:
59-
name: wwhd_rando_${{ github.event.release.tag_name }}_mac.dmg # pass name so it doesn't get put in a folder
72+
name: wwhd_rando_${{ github.event.release.tag_name }}_mac_arm.dmg # pass name so it doesn't get put in a folder
6073

6174
- name: Zip windows file
6275
uses: montudor/action-zip@v1
@@ -69,4 +82,4 @@ jobs:
6982
run: |
7083
ls -R
7184
mv wwhd_rando.dmg wwhd_rando_${{ github.event.release.tag_name }}_mac.dmg
72-
gh release upload ${{ github.event.release.tag_name }} wwhd_rando_${{ github.event.release.tag_name }}_windows.zip wwhd_rando.wuhb wwhd_rando_${{ github.event.release.tag_name }}_mac.dmg
85+
gh release upload ${{ github.event.release.tag_name }} wwhd_rando_${{ github.event.release.tag_name }}_windows.zip wwhd_rando.wuhb wwhd_rando_${{ github.event.release.tag_name }}_mac_x64.dmg wwhd_rando_${{ github.event.release.tag_name }}_mac_arm.dmg

0 commit comments

Comments
 (0)