forked from FULU-Foundation/OrcaSlicer-bambulab
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild_macos_bridge.yml
More file actions
241 lines (203 loc) · 8 KB
/
Copy pathbuild_macos_bridge.yml
File metadata and controls
241 lines (203 loc) · 8 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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
name: Build macOS with Linux bridge runtime
on:
workflow_call:
workflow_dispatch:
jobs:
prepare_linux_bridge_runtime:
name: Prepare Linux bridge runtime
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v6
with:
lfs: 'false'
- uses: lukka/get-cmake@latest
with:
cmakeVersion: "~4.3.0"
useLocalCache: true
useCloudCache: true
- name: Apt-Install Dependencies
uses: ./.github/actions/apt-install-deps
- name: Build Linux deps
shell: bash
run: |
set -euo pipefail
for attempt in 1 2 3; do
echo "Build Linux deps attempt $attempt"
if ./build_linux.sh -drlL; then
exit 0
fi
if [ "$attempt" -lt 3 ]; then
echo "Transient dependency download/build failure, retrying after backoff"
sleep $((attempt * 20))
fi
done
exit 1
- name: Configure linux bridge host build
shell: bash
run: |
cmake -S . -B build -G "Ninja Multi-Config" -DORCA_TOOLS=ON
- name: Build linux host runtime
shell: bash
run: |
cmake --build build --config Release --target pjarczak_bambu_linux_host
bash tools/pjarczak_bambu_linux_host/package_linux_host_runtime.sh build
tar -czvf linux_host_runtime_${{ github.sha }}.tar.gz -C tools/pjarczak_bambu_linux_host/runtime linux-x86_64
- name: Upload linux host runtime artifact
uses: actions/upload-artifact@v7
with:
name: linux_host_runtime_macos_${{ github.sha }}
path: ./linux_host_runtime_${{ github.sha }}.tar.gz
if-no-files-found: error
build_macos_arm64:
name: Build macOS arm64
runs-on: macos-14
needs: prepare_linux_bridge_runtime
env:
ORCA_UPDATER_SIG_KEY: ${{ secrets.ORCA_UPDATER_SIG_KEY }}
steps:
- name: Checkout
uses: actions/checkout@v6
with:
lfs: 'false'
- uses: lukka/get-cmake@latest
with:
cmakeVersion: "~4.3.0"
useLocalCache: true
useCloudCache: true
- name: Download linux host runtime artifact
uses: actions/download-artifact@v8
with:
name: linux_host_runtime_macos_${{ github.sha }}
path: ${{ github.workspace }}/linux_host_runtime_artifact
- name: Extract linux host runtime artifact on macOS arm64
shell: bash
run: |
mkdir -p "$GITHUB_WORKSPACE/tools/pjarczak_bambu_linux_host/runtime"
tar -xzf "$GITHUB_WORKSPACE/linux_host_runtime_artifact/linux_host_runtime_${{ github.sha }}.tar.gz" -C "$GITHUB_WORKSPACE/tools/pjarczak_bambu_linux_host/runtime"
- name: Install mac tools
shell: bash
run: |
brew install automake texinfo libtool
brew list
mkdir -p "$GITHUB_WORKSPACE/deps/build/arm64"
- name: Build macOS arm64 deps
shell: bash
run: |
./build_release_macos.sh -dx -1 -a arm64 -t 11.3
- name: Build macOS arm64 app bundle
shell: bash
run: |
./build_release_macos.sh -s -n -x -1 -a arm64 -t 11.3
- name: Pack macOS arm64 app bundle
shell: bash
run: |
tar -czvf OrcaSlicer_Mac_bundle_arm64_${{ github.sha }}.tar.gz -C build/arm64 OrcaSlicer
- name: Upload macOS arm64 app bundle
uses: actions/upload-artifact@v7
with:
name: OrcaSlicer_Mac_bundle_arm64_${{ github.sha }}
path: ${{ github.workspace }}/OrcaSlicer_Mac_bundle_arm64_${{ github.sha }}.tar.gz
if-no-files-found: error
build_macos_x86_64:
name: Build macOS x86_64
runs-on: macos-14
needs: prepare_linux_bridge_runtime
env:
ORCA_UPDATER_SIG_KEY: ${{ secrets.ORCA_UPDATER_SIG_KEY }}
steps:
- name: Checkout
uses: actions/checkout@v6
with:
lfs: 'false'
- uses: lukka/get-cmake@latest
with:
cmakeVersion: "~4.3.0"
useLocalCache: true
useCloudCache: true
- name: Download linux host runtime artifact
uses: actions/download-artifact@v8
with:
name: linux_host_runtime_macos_${{ github.sha }}
path: ${{ github.workspace }}/linux_host_runtime_artifact
- name: Extract linux host runtime artifact on macOS x86_64
shell: bash
run: |
mkdir -p "$GITHUB_WORKSPACE/tools/pjarczak_bambu_linux_host/runtime"
tar -xzf "$GITHUB_WORKSPACE/linux_host_runtime_artifact/linux_host_runtime_${{ github.sha }}.tar.gz" -C "$GITHUB_WORKSPACE/tools/pjarczak_bambu_linux_host/runtime"
- name: Install mac tools
shell: bash
run: |
brew install automake texinfo libtool
brew list
mkdir -p "$GITHUB_WORKSPACE/deps/build/x86_64"
- name: Build macOS x86_64 deps
shell: bash
run: |
./build_release_macos.sh -dx -1 -a x86_64 -t 11.3
- name: Build macOS x86_64 app bundle
shell: bash
run: |
./build_release_macos.sh -s -n -x -1 -a x86_64 -t 11.3
- name: Pack macOS x86_64 app bundle
shell: bash
run: |
tar -czvf OrcaSlicer_Mac_bundle_x86_64_${{ github.sha }}.tar.gz -C build/x86_64 OrcaSlicer
- name: Upload macOS x86_64 app bundle
uses: actions/upload-artifact@v7
with:
name: OrcaSlicer_Mac_bundle_x86_64_${{ github.sha }}
path: ${{ github.workspace }}/OrcaSlicer_Mac_bundle_x86_64_${{ github.sha }}.tar.gz
if-no-files-found: error
build_macos_universal:
name: Build macOS universal
runs-on: macos-14
needs:
- build_macos_arm64
- build_macos_x86_64
steps:
- name: Checkout
uses: actions/checkout@v6
with:
lfs: 'false'
- uses: lukka/get-cmake@latest
with:
cmakeVersion: "~4.3.0"
useLocalCache: true
useCloudCache: true
- name: Download macOS app bundles
uses: actions/download-artifact@v8
with:
pattern: OrcaSlicer_Mac_bundle_*_${{ github.sha }}
path: ${{ github.workspace }}/mac_bundles
- name: Extract macOS app bundles
shell: bash
run: |
mkdir -p build/arm64 build/x86_64
arm_bundle=$(find "$GITHUB_WORKSPACE/mac_bundles/OrcaSlicer_Mac_bundle_arm64_${{ github.sha }}" -name '*.tar.gz' -print -quit)
x86_bundle=$(find "$GITHUB_WORKSPACE/mac_bundles/OrcaSlicer_Mac_bundle_x86_64_${{ github.sha }}" -name '*.tar.gz' -print -quit)
tar -xzvf "$arm_bundle" -C "$GITHUB_WORKSPACE/build/arm64"
tar -xzvf "$x86_bundle" -C "$GITHUB_WORKSPACE/build/x86_64"
- name: Build universal mac app bundle
shell: bash
run: |
./build_release_macos.sh -u -x -1 -a universal -t 11.3
- name: Create DMG without runtime validation
shell: bash
run: |
mkdir -p "$GITHUB_WORKSPACE/build/universal/OrcaSlicer_dmg"
rm -rf "$GITHUB_WORKSPACE/build/universal/OrcaSlicer_dmg"/*
cp -R "$GITHUB_WORKSPACE/build/universal/OrcaSlicer/OrcaSlicer.app" "$GITHUB_WORKSPACE/build/universal/OrcaSlicer_dmg/"
ln -sfn /Applications "$GITHUB_WORKSPACE/build/universal/OrcaSlicer_dmg/Applications"
ver=$(grep 'set(SoftFever_VERSION' version.inc | cut -d '"' -f2)
hdiutil create -volname "OrcaSlicer" -srcfolder "$GITHUB_WORKSPACE/build/universal/OrcaSlicer_dmg" -ov -format UDZO "OrcaSlicer_Mac_universal_V${ver}.dmg"
- name: Explain skipped hosted runtime validation
shell: bash
run: |
echo "Hosted macOS runners do not support nested virtualization, so bundled Lima runtime validation is intentionally skipped here."
- name: Upload macOS universal DMG
uses: actions/upload-artifact@v7
with:
name: OrcaSlicer_Mac_universal_${{ github.sha }}
path: ${{ github.workspace }}/OrcaSlicer_Mac_universal_V*.dmg
if-no-files-found: error