forked from pguyot/Einstein
-
Notifications
You must be signed in to change notification settings - Fork 0
317 lines (307 loc) · 11.7 KB
/
release.yml
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
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
#
# This script will tag the repo, compile and zip Einstein, and publish it
# as a GitHub Release.
#
name: 'Deploy Einstein on GitHub'
# This job must be called explicitily form the 'Actions' tab in github
on:
workflow_dispatch:
inputs:
# The Version Tag is extracted from CMakeLists.txt
#version_tag:
# description: 'Release Version Tag'
# required: true
# default: '2022.4.15'
build-macos-universal-fltk:
type: boolean
description: Build macOS Universal FLTK
default: 'true'
build-macos-universal-cocoa:
type: boolean
description: Build macOS Universal Cocoa
default: 'true'
build-linux-x64-fltk:
type: boolean
description: Build Linux x64 FLTK
default: 'true'
#build-linux-arm64-fltk:
# type: boolean
# description: Build Linux arm64 FLTK
# default: 'true'
build-windows-x64-fltk:
type: boolean
description: Build Windows x64 FLTK
default: 'true'
build-windows-arm64-fltk:
type: boolean
description: Build Windows arm64 FLTK
default: 'true'
# build-linux-arm64-fltk:
# build-android
# build-iOS
# Windows cmake build option for arm64 is -A ARM64
# On Linux, we will have to do additional installes and set a bunch of environment variables
jobs:
# Build the MacOS FLTK version as a Universal Binary for x64 and ARM64
build-macos-universal-fltk:
runs-on: macos-latest
if: ${{ github.event.inputs.build-macos-universal-fltk == 'true' }}
steps:
- name: Get Einstein Sources
uses: actions/checkout@v2
- name: Get Release Version Tag
run: |
export RELEASE_TAG="v"`grep -o '"Einstein" VERSION "[^"]*' CMakeLists.txt | grep -o '[^"]*$'`
echo "RELEASE_TAG=$RELEASE_TAG"
echo "RELEASE_TAG=$RELEASE_TAG" >> $GITHUB_ENV
- name: Get FLTK
uses: actions/checkout@v2
with:
repository: fltk/fltk
path: fltk
- name: Get newt64
uses: actions/checkout@v2
with:
repository: MatthiasWM/NEWT64
path: newt64
- name: Compile FLTK
run: |
cmake -S fltk -B fltk/build \
-D OPTION_USE_SYSTEM_LIBJPEG=Off \
-D OPTION_USE_SYSTEM_ZLIB=Off \
-D OPTION_USE_SYSTEM_LIBPNG=Off \
-D FLTK_BUILD_TEST=Off \
-D OPTION_USE_GL=Off \
-D CMAKE_BUILD_TYPE=Release \
-D CMAKE_OSX_DEPLOYMENT_TARGET=10.9 \
-D "CMAKE_OSX_ARCHITECTURES=arm64;x86_64"
cmake --build fltk/build
- name: Compile newt64
run: |
cmake -S newt64 -B newt64/build \
-D CMAKE_BUILD_TYPE=Release \
-D CMAKE_OSX_DEPLOYMENT_TARGET=10.9 \
-D "CMAKE_OSX_ARCHITECTURES=arm64;x86_64"
cmake --build newt64/build
- name: Compile Einstein
run: |
cmake -S . -B build \
-D CMAKE_BUILD_TYPE=Release \
-D CMAKE_OSX_DEPLOYMENT_TARGET=10.9 \
-D "CMAKE_OSX_ARCHITECTURES=arm64;x86_64"
cmake --build build --target Einstein
- name: Pack Einstein
run: |
mv build/Einstein.app .
cmake -E tar cf Einstein_macOS_universal_fltk_${{env.RELEASE_TAG}}.zip --format=zip Einstein.app
- name: Publish Einstein
uses: ncipollo/release-action@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
allowUpdates: 'true'
artifacts: Einstein_macOS_universal_fltk_${{env.RELEASE_TAG}}.zip
artifactContentType: application/zip
bodyFile: ReleaseText.md
tag: ${{ env.RELEASE_TAG }}
token: ${{ secrets.GITHUB_TOKEN }}
build-linux-x64-fltk:
runs-on: ubuntu-latest
if: ${{ github.event.inputs.build-linux-x64-fltk == 'true' }}
steps:
- name: Get dependencies
run: |
sudo apt-get install -y libpulse-dev ninja-build libbsd-dev
wget --no-check-certificate -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
sudo add-apt-repository 'deb http://apt.llvm.org/focal/ llvm-toolchain-focal-13 main'
sudo apt-get update
sudo apt-get install clang-format-13
- name: Get sources
uses: actions/checkout@v2
- name: Get Version
run: |
export RELEASE_TAG="v"`grep -o '"Einstein" VERSION "[^"]*' CMakeLists.txt | grep -o '[^"]*$'`
echo "RELEASE_TAG=$RELEASE_TAG"
echo "RELEASE_TAG=$RELEASE_TAG" >> $GITHUB_ENV
- name: Get FLTK
uses: actions/checkout@v2
with:
repository: fltk/fltk
path: fltk
- name: Get newt64
uses: actions/checkout@v2
with:
repository: MatthiasWM/NEWT64
path: newt64
- name: Compile FLTK
run: |
cmake -S fltk -B fltk/build \
-D OPTION_USE_SYSTEM_LIBJPEG=Off \
-D OPTION_USE_SYSTEM_ZLIB=Off \
-D OPTION_USE_SYSTEM_LIBPNG=Off \
-D FLTK_BUILD_TEST=Off \
-D OPTION_USE_GL=Off \
-D CMAKE_BUILD_TYPE=Release
cmake --build fltk/build
- name: Compile newt64
run: |
cmake -S newt64 -B newt64/build \
-D CMAKE_BUILD_TYPE=Release
cmake --build newt64/build
- name: Compile Einstein
run: |
cmake -S . -B build \
-D CMAKE_BUILD_TYPE=Release
cmake --build build --target Einstein
- name: Pack Einstein
run: |
mv build/Einstein .
cmake -E tar cf Einstein_linux_x64_fltk_${{env.RELEASE_TAG}}.zip --format=zip Einstein
- name: Publish Einstein
uses: ncipollo/release-action@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
allowUpdates: 'true'
artifacts: Einstein_linux_x64_fltk_${{env.RELEASE_TAG}}.zip
artifactContentType: application/zip
bodyFile: ReleaseText.md
tag: ${{ env.RELEASE_TAG }}
token: ${{ secrets.GITHUB_TOKEN }}
build-macos-universal-cocoa:
runs-on: macos-latest
if: ${{ github.event.inputs.build-macos-universal-cocoa == 'true' }}
steps:
- uses: actions/checkout@v2
- name: Get Release Version Tag
run: |
export RELEASE_TAG="v"`grep -o '"Einstein" VERSION "[^"]*' CMakeLists.txt | grep -o '[^"]*$'`
echo "RELEASE_TAG=$RELEASE_TAG"
echo "RELEASE_TAG=$RELEASE_TAG" >> $GITHUB_ENV
- name: Build
run: |
xcodebuild archive \
-project _Build_/Xcode/Einstein.xcodeproj \
-scheme Einstein -configuration Release \
-archivePath Einstein.xcarchive \
ONLY_ACTIVE_ARCH=NO
- name: Pack Einstein
run: |
mv Einstein.xcarchive/Products/Applications/Einstein.app .
cmake -E tar cf Einstein_macOS_universal_cocoa_${{env.RELEASE_TAG}}.zip --format=zip Einstein.app
- name: Publish Einstein
uses: ncipollo/release-action@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
allowUpdates: 'true'
artifacts: Einstein_macOS_universal_cocoa_${{env.RELEASE_TAG}}.zip
artifactContentType: application/zip
bodyFile: ReleaseText.md
tag: ${{ env.RELEASE_TAG }}
token: ${{ secrets.GITHUB_TOKEN }}
build-windows-x64-fltk:
runs-on: windows-2019
if: ${{ github.event.inputs.build-windows-x64-fltk == 'true' }}
steps:
- name: Get sources
uses: actions/checkout@v2
- name: Get Version
shell: pwsh
run: |
# Select-String -Path CMakeLists.txt -CaseSensitive -Pattern '"Einstein" VERSION'
$env:RELEASE_TAG2=(Select-String -Path CMakeLists.txt -CaseSensitive -Pattern '"Einstein" VERSION')
# gci env:RELEASE_TAG2
$env:RELEASE_TAG=($env:RELEASE_TAG2 -replace '.* VERSION "', '' -replace '".*\)', '')
# gci env:RELEASE_TAG
echo "RELEASE_TAG=v$env:RELEASE_TAG"
echo "RELEASE_TAG=v$env:RELEASE_TAG" >> $env:GITHUB_ENV
- name: Get FLTK
uses: actions/checkout@v2
with:
repository: fltk/fltk
path: fltk
- name: Get newt64
uses: actions/checkout@v2
with:
repository: MatthiasWM/NEWT64
path: newt64
- name: Compile FLTK
run: |
cmake -S fltk -B fltk/build -A x64 -D OPTION_USE_SYSTEM_LIBJPEG=Off -D OPTION_USE_SYSTEM_ZLIB=Off -D OPTION_USE_SYSTEM_LIBPNG=Off -D FLTK_BUILD_TEST=Off -D OPTION_USE_GL=Off -D CMAKE_BUILD_TYPE=Release
cmake --build fltk/build --config Release
- name: Compile newt64
run: |
cmake -S newt64 -B newt64/build -A x64 -D CMAKE_BUILD_TYPE=Release
cmake --build newt64/build --config Release
- name: Compile Einstein
run: |
cmake -S . -B build -A x64 -D CMAKE_BUILD_TYPE=Release
cmake --build build --config Release --target Einstein
- name: Pack Einstein
run: |
mv build/Release/Einstein.exe .
cmake -E tar cf Einstein_windows_x64_fltk_${{env.RELEASE_TAG}}.zip --format=zip Einstein.exe
- uses: ncipollo/release-action@v1
with:
allowUpdates: 'true'
artifacts: Einstein_windows_x64_fltk_${{env.RELEASE_TAG}}.zip
artifactContentType: application/zip
bodyFile: ReleaseText.md
tag: ${{ env.RELEASE_TAG }}
token: ${{ secrets.GITHUB_TOKEN }}
# Cross-compile for ARM64 CPUs
build-windows-arm64-fltk:
runs-on: windows-2019
if: ${{ github.event.inputs.build-windows-arm64-fltk == 'true' }}
steps:
- name: Get sources
uses: actions/checkout@v2
- name: Get Version
shell: pwsh
run: |
# Select-String -Path CMakeLists.txt -CaseSensitive -Pattern '"Einstein" VERSION'
$env:RELEASE_TAG2=(Select-String -Path CMakeLists.txt -CaseSensitive -Pattern '"Einstein" VERSION')
# gci env:RELEASE_TAG2
$env:RELEASE_TAG=($env:RELEASE_TAG2 -replace '.* VERSION "', '' -replace '".*\)', '')
# gci env:RELEASE_TAG
echo "RELEASE_TAG=v$env:RELEASE_TAG"
echo "RELEASE_TAG=v$env:RELEASE_TAG" >> $env:GITHUB_ENV
- name: Get FLTK
uses: actions/checkout@v2
with:
repository: fltk/fltk
path: fltk
- name: Get newt64
uses: actions/checkout@v2
with:
repository: MatthiasWM/NEWT64
path: newt64
- name: Compile FLTK Native for Fluid
run: |
cmake -S fltk -B fltk/buildNative -D OPTION_USE_SYSTEM_LIBJPEG=Off -D OPTION_USE_SYSTEM_ZLIB=Off -D OPTION_USE_SYSTEM_LIBPNG=Off -D FLTK_BUILD_TEST=Off -D OPTION_USE_GL=Off -D CMAKE_BUILD_TYPE=Release
cmake --build fltk/buildNative --config Release
- name: Compile FLTK
run: |
cmake -S fltk -B fltk/build -A ARM64 -D OPTION_USE_SYSTEM_LIBJPEG=Off -D OPTION_USE_SYSTEM_ZLIB=Off -D OPTION_USE_SYSTEM_LIBPNG=Off -D FLTK_BUILD_TEST=Off -D OPTION_USE_GL=Off -D CMAKE_BUILD_TYPE=Release
cmake --build fltk/build --config Release
- name: Compile newt64
run: |
cmake -S newt64 -B newt64/build -A ARM64 -D CMAKE_BUILD_TYPE=Release
cmake --build newt64/build --config Release
- name: Compile Einstein
run: |
cmake -S . -B build -A ARM64 -D CMAKE_BUILD_TYPE=Release
cmake --build build --config Release --target Einstein
- name: Pack Einstein
run: |
mv build/Release/Einstein.exe .
cmake -E tar cf Einstein_windows_arm64_fltk_${{env.RELEASE_TAG}}.zip --format=zip Einstein.exe
- uses: ncipollo/release-action@v1
with:
allowUpdates: 'true'
artifacts: Einstein_windows_arm64_fltk_${{env.RELEASE_TAG}}.zip
artifactContentType: application/zip
bodyFile: ReleaseText.md
tag: ${{ env.RELEASE_TAG }}
token: ${{ secrets.GITHUB_TOKEN }}