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