forked from solvespace/solvespace
-
Notifications
You must be signed in to change notification settings - Fork 0
268 lines (255 loc) · 8.58 KB
/
cd.yml
File metadata and controls
268 lines (255 loc) · 8.58 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
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
name: CD
on:
push:
branches:
- master
release:
types:
- created
jobs:
cancel_previous_runs:
runs-on: ubuntu-latest
name: Cancel Previous Runs
permissions:
actions: write
steps:
- uses: styfle/cancel-workflow-action@0.12.1
with:
access_token: ${{ github.token }}
test_ubuntu:
needs: [cancel_previous_runs]
runs-on: ubuntu-latest
name: Test Ubuntu
steps:
- uses: actions/checkout@v4
- name: Install Dependencies
run: .github/scripts/install-ubuntu.sh
- name: Build & Test
run: .github/scripts/build-ubuntu.sh
test_windows:
needs: [cancel_previous_runs]
runs-on: windows-2022
name: Test Windows
steps:
- uses: actions/checkout@v4
- name: Install Dependencies
run: .github/scripts/install-windows.sh
shell: bash
- name: Build & Test
run: .github/scripts/build-windows.sh
shell: bash
test_macos:
needs: [cancel_previous_runs]
runs-on: macos-latest
name: Test macOS
steps:
- uses: actions/checkout@v4
- name: Install Dependencies
run: .github/scripts/install-macos.sh ci
- name: Build & Test
run: .github/scripts/build-macos.sh debug arm64 && .github/scripts/build-macos.sh debug x86_64
build_release_windows:
needs: [test_ubuntu, test_windows, test_macos]
name: Build Release Windows
runs-on: windows-2022
steps:
- uses: actions/checkout@v4
- name: Install Dependencies
run: .github/scripts/install-windows.sh
shell: bash
- name: Build & Test
run: .github/scripts/build-windows.sh release
shell: bash
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: windows_single_core
path: build/bin/RelWithDebInfo/solvespace_single_core.exe
build_release_windows_openmp:
needs: [test_ubuntu, test_windows, test_macos]
name: Build Release Windows (OpenMP)
runs-on: windows-2022
steps:
- uses: actions/checkout@v4
- name: Install Dependencies
run: .github/scripts/install-windows.sh
shell: bash
- name: Build & Test
run: .github/scripts/build-windows.sh release openmp
shell: bash
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: windows
path: build/bin/RelWithDebInfo/solvespace.exe
build_release_windows_x64:
needs: [test_ubuntu, test_windows, test_macos]
name: Build Release Windows x64
runs-on: windows-2022
steps:
- uses: actions/checkout@v4
- name: Install Dependencies
run: .github/scripts/install-windows.sh
shell: bash
- name: Build & Test
run: .github/scripts/build-windows.sh release not_openmp x64
shell: bash
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: windows_single_core_x64
path: build/bin/RelWithDebInfo/solvespace_single_core_x64.exe
build_release_windows_openmp_x64:
needs: [test_ubuntu, test_windows, test_macos]
name: Build Release Windows (OpenMP) x64
runs-on: windows-2022
steps:
- uses: actions/checkout@v4
- name: Install Dependencies
run: .github/scripts/install-windows.sh
shell: bash
- name: Build & Test
run: .github/scripts/build-windows.sh release openmp x64
shell: bash
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: windows_x64
path: build/bin/RelWithDebInfo/solvespace_x64.exe
build_release_macos:
needs: [test_ubuntu, test_windows, test_macos]
name: Build Release macOS
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Install Dependencies
run: .github/scripts/install-macos.sh ci
- name: Build & Test
run: .github/scripts/build-macos.sh release arm64 && .github/scripts/build-macos.sh release x86_64
- name: Sign Build
run: .github/scripts/sign-macos.sh
env:
MACOS_CERTIFICATE_PASSWORD: ${{ secrets.MACOS_CERTIFICATE_PASSWORD }}
MACOS_CERTIFICATE_P12: ${{ secrets.MACOS_CERTIFICATE_P12 }}
MACOS_APPSTORE_APP_PASSWORD: ${{ secrets.MACOS_APPSTORE_APP_PASSWORD }}
MACOS_APPSTORE_USERNAME: ${{ secrets.MACOS_APPSTORE_USERNAME }}
MACOS_DEVELOPER_ID: ${{ secrets.MACOS_DEVELOPER_ID }}
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: macos
path: build/bin/SolveSpace.dmg
build_release_web:
needs: [test_ubuntu, test_windows, test_macos]
name: Build Release Web
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Dependencies
run: .github/scripts/install-web.sh
- name: Build & Pack
run: |
.github/scripts/build-web.sh release
cd build/bin
rm *.a || true
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: solvespace_web
path: build/bin/
# deploy_snap_amd64:
# needs: [test_ubuntu, test_windows, test_macos]
# name: Deploy AMD64 Snap
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# - name: Fetch Tags
# run: git fetch --force --tags
# - name: Set Up Source
# run: rsync --filter=":- .gitignore" -r ./ pkg/snap/solvespace-snap-src
# - name: Build Snap
# uses: snapcore/action-build@v1
# id: build
# with:
# path: pkg/snap
# - name: Upload & Release to Edge
# if: github.event_name == 'push'
# uses: snapcore/action-publish@v1
# env:
# SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPSTORE_LOGIN }}
# with:
# snap: ${{ steps.build.outputs.snap }}
# release: edge
# - name: Upload & Release to Beta + Edge
# if: github.event_name == 'release'
# uses: snapcore/action-publish@v1
# with:
# store_login: ${{ secrets.SNAPSTORE_LOGIN }}
# snap: ${{ steps.build.outputs.snap }}
# release: edge,beta
upload_release_assets:
name: Upload Release Assets
needs: [build_release_windows, build_release_windows_openmp, build_release_windows_x64, build_release_windows_openmp_x64, build_release_macos]
if: "!cancelled() && github.event_name == 'release'"
runs-on: ubuntu-latest
steps:
- name: Download All Workflow Artifacts
uses: actions/download-artifact@v4
- name: Get Release Upload URL
id: get_upload_url
env:
event: ${{ toJson(github.event) }}
run: |
upload_url=$(echo "$event" | jq -r ".release.upload_url")
echo "::set-output name=upload_url::$upload_url"
echo "Upload URL: $upload_url"
- name: Upload solvespace.exe
uses: actions/upload-release-asset@v1
continue-on-error: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.get_upload_url.outputs.upload_url }}
asset_path: windows/solvespace.exe
asset_name: solvespace.exe
asset_content_type: binary/octet-stream
- name: Upload solvespace_single_core.exe
uses: actions/upload-release-asset@v1
continue-on-error: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.get_upload_url.outputs.upload_url }}
asset_path: windows-openmp/solvespace_single_core.exe
asset_name: solvespace_single_core.exe
asset_content_type: binary/octet-stream
- name: Upload solvespace_x64.exe
uses: actions/upload-release-asset@v1
continue-on-error: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.get_upload_url.outputs.upload_url }}
asset_path: windows/solvespace_x64.exe
asset_name: solvespace_x64.exe
asset_content_type: binary/octet-stream
- name: Upload solvespace_single_core_x64.exe
uses: actions/upload-release-asset@v1
continue-on-error: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.get_upload_url.outputs.upload_url }}
asset_path: windows-openmp/solvespace_single_core_x64.exe
asset_name: solvespace_single_core_x64.exe
asset_content_type: binary/octet-stream
- name: Upload SolveSpace.dmg
uses: actions/upload-release-asset@v1
continue-on-error: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.get_upload_url.outputs.upload_url }}
asset_path: macos/SolveSpace.dmg
asset_name: SolveSpace.dmg
asset_content_type: binary/octet-stream