-
Notifications
You must be signed in to change notification settings - Fork 99
627 lines (550 loc) · 26.6 KB
/
github-travis.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
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
# This workflow will build a package using Maven and then publish it to GitHub packages when a release is created
# For more information see: https://github.com/actions/setup-java#apache-maven-with-a-settings-path
name: Complete Build
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: [ GAMA_1.9.3 ]
schedule:
- cron: "0 0 * * *"
workflow_dispatch: # For manual trigger
inputs:
is_release:
description: 'Is this a stable release ?'
required: true
default: false
type: boolean
jobs:
#
# ██████╗ ██╗ ██╗██╗██╗ ██████╗ ██╗███╗ ██╗ ██████╗
# ██╔══██╗██║ ██║██║██║ ██╔══██╗██║████╗ ██║██╔════╝
# ██████╔╝██║ ██║██║██║ ██║ ██║██║██╔██╗ ██║██║ ███╗
# ██╔══██╗██║ ██║██║██║ ██║ ██║██║██║╚██╗██║██║ ██║
# ██████╔╝╚██████╔╝██║███████╗██████╔╝██║██║ ╚████║╚██████╔╝
# ╚═════╝ ╚═════╝ ╚═╝╚══════╝╚═════╝ ╚═╝╚═╝ ╚═══╝ ╚═════╝
#
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Adopt OpenJDK 17
uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: '17'
java-package: jdk
- name: Prepare build
run: |
echo "MAVEN_OPTS='-Dorg.slf4j.simpleLogger.defaultLogLevel=info -XX:+TieredCompilation -XX:TieredStopAtLevel=1 -Xmx4g'" >> ~/.mavenrc
sudo chmod +x $GITHUB_WORKSPACE/travis/*.sh
- name: Import & Prepare JAR signing
run: |
echo "$GAMA_KEYSTORE_BASE64" | base64 --decode > ~/gama.keystore
# Config file
sed -i "s/<storepass>GAMA_STORE/<storepass>$GAMA_STORE/g" $GITHUB_WORKSPACE/ummisco.gama.annotations/pom.xml
sed -i "s/<storepass>GAMA_STORE/<storepass>$GAMA_STORE/g" $GITHUB_WORKSPACE/msi.gama.processor/pom.xml
sed -i "s/<storepass>GAMA_STORE/<storepass>$GAMA_STORE/g" $GITHUB_WORKSPACE/msi.gama.parent/pom.xml
# Trigger jar signing plugin
touch $GITHUB_WORKSPACE/sign.maven
env:
GAMA_KEYSTORE_BASE64: ${{ secrets.GAMA_KEYSTORE_BASE64 }}
GAMA_STORE: ${{ secrets.GAMA_KEYSTORE_STOREPASS }}
- name: Build with Maven
shell: bash
run: $GITHUB_WORKSPACE/travis/compile.sh
env:
MSG: ${ github.event.head_commit.message }
- name: Validate and test Maven
shell: bash
run: $GITHUB_WORKSPACE/travis/validate_and_test.sh
- name: Clean latest git message for next job's step
id: cleanGitMessage
run: |
export commitMessage=$( echo ${{ toJSON(github.event.head_commit.message)}} | sed -e "s/'/ /g" | sed -e 's/"/ /g')
echo "cleaned=$commitMessage" >> "$GITHUB_OUTPUT"
echo $commitMessage
- name: Check if should release version
run: |
if [[ "${{ github.event_name }}" == "workflow_dispatch" || "${{ steps.cleanGitMessage.outputs.cleaned }}" == *"ci release"* ]]; then
echo "The action will continue and create a release"
echo "CONTINUE=true" >> $GITHUB_ENV
else
echo "The action will nicely stop now"
echo "CONTINUE=false" >> $GITHUB_ENV
./travis/ci-gateway.sh
fi
echo ${{ env.CONTINUE }}
env:
SSH_HOST: ${{ secrets.SSH_HOST }}
MSG: ${{ env.TRAVIS_MSG }}
SSHPASS: ${{ secrets.USER_PWD }}
BOT_TOKEN: ${{ secrets.BOT_TOKEN }}
TRAVIS_EVENT_TYPE: ${{ github.event_name }}
- name: Make zip file
if: env.CONTINUE == 'true'
shell: bash
run: $GITHUB_WORKSPACE/travis/zip_withjdk.sh
env:
GAMA_KEYSTORE_BASE64: ${{ secrets.GAMA_KEYSTORE_BASE64 }}
GAMA_STORE: ${{ secrets.GAMA_KEYSTORE_STOREPASS }}
- name: Convert maven tarball to zip archives
if: env.CONTINUE == 'true'
shell: bash
run: |
# Move to appropriate folder
cd ${{ github.workspace }}/ummisco.gama.product/target/products/
# Clear downloaded JDKs
rm -fr ./jdk_*
# Convert to zip archives
find . -name "Gama1.7-*.tar.gz" -print -exec bash -c 'tar xzf {} && zip -9 -r -q $(basename \{} .tar.gz).zip $(tar --exclude="*/*" -tf {}) && rm -fr $(tar tf {}) {} && echo "Compressed and convert {} to zip"' \;
# cf https://github.com/actions/upload-artifact/issues/246
- name: Move artefacts to root tree
if: env.CONTINUE == 'true'
run: |
# MacOS Family
mv ${{ github.workspace }}/ummisco.gama.product/target/products/Gama*zip ${{ github.workspace }}
mv ${{ github.workspace }}/travis/mac-sign.sh ${{ github.workspace }}
mv ${{ github.workspace }}/travis/what2sign.sh ${{ github.workspace }}
mv ${{ github.workspace }}/ummisco.gama.product/extraresources/installer/windows/* ${{ github.workspace }}
# Debian Family
mv Gama1.7-linux.gtk.x86_64.zip gama-platform_1.9.3-1_amd64.zip
mv Gama1.7-linux.gtk.x86_64_withJDK.zip gama-platform-jdk_1.9.3-1_amd64.zip
cd ${{ github.workspace }}/ummisco.gama.product/extraresources/installer/unix && zip -r ${{ github.workspace }}/extraresources-unix.zip . && cd -
- uses: actions/upload-artifact@v2
if: env.CONTINUE == 'true'
with:
name: gama-mac-unsigned
path: |
./Gama1.7-macosx*zip
./mac-sign.sh
./what2sign.sh
- uses: actions/upload-artifact@v2
if: env.CONTINUE == 'true'
with:
name: gama-linux-jdk
path: |
./gama-platform*amd64.zip
./extraresources-unix.zip
- uses: actions/upload-artifact@v2
if: env.CONTINUE == 'true'
with:
name: gama-windows
path: |
./Gama1.7-win32*zip
./icon256.ico
./windows_installer_script.iss
./LICENSE
- uses: actions/upload-artifact@v2
if: env.CONTINUE == 'true'
with:
name: gama-zip-builds
path: |
./Gama1.7-win32*zip
./gama-platform*amd64.zip
outputs:
continue_pipeline: ${{ env.CONTINUE }}
#
# ██████╗ █████╗ ██████╗██╗ ██╗ █████╗ ██████╗ ██╗███╗ ██╗ ██████╗
# ██╔══██╗██╔══██╗██╔════╝██║ ██╔╝██╔══██╗██╔════╝ ██║████╗ ██║██╔════╝
# ██████╔╝███████║██║ █████╔╝ ███████║██║ ███╗██║██╔██╗ ██║██║ ███╗
# ██╔═══╝ ██╔══██║██║ ██╔═██╗ ██╔══██║██║ ██║██║██║╚██╗██║██║ ██║
# ██║ ██║ ██║╚██████╗██║ ██╗██║ ██║╚██████╔╝██║██║ ╚████║╚██████╔╝
# ╚═╝ ╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝ ╚═╝╚═╝ ╚═══╝ ╚═════╝
#
#
# __ __ _____ ____ _____
# | \/ | /\ / ____| / __ \ / ____|
# | \ / | / \ | | | | | | (___
# | |\/| | / /\ \| | | | | |\___ \
# | | | |/ ____ \ |____ | |__| |____) |
# |_| |_/_/ \_\_____| \____/|_____/
#
macOS-pre-signing:
needs: build
if: needs.build.outputs.continue_pipeline == 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v2
with:
name: gama-mac-unsigned
- name: Calculate what Jar to sign
run: |
bash what2sign.sh
echo "\nPrint `needToSign.txt` :"
cat needToSign.txt
- uses: actions/upload-artifact@v2
with:
name: gama-mac-what2sign
path: |
./needToSign.txt
macOS-signing:
needs: macOS-pre-signing
runs-on: macos-latest
strategy:
matrix:
zipName: [Gama1.7-macosx.cocoa.x86_64, Gama1.7-macosx.cocoa.x86_64_withJDK, Gama1.7-macosx.cocoa.aarch64, Gama1.7-macosx.cocoa.aarch64_withJDK]
steps:
- uses: actions/checkout@v2
- name: Prepare vm
shell: bash
run: |
# Change XCode version
export JAVA_HOME=$JAVA_HOME_17_X64
mkdir -p ${{ github.workspace }}/artifacts/work
- uses: actions/download-artifact@v2
with:
name: gama-mac-what2sign
- uses: actions/download-artifact@v2
with:
name: gama-mac-unsigned
path: ./artifacts/
- name: Create Keychain
shell: bash
env:
MACOS_CERTIFICATE: ${{ secrets.MACOS_CERTIFICATE }}
MACOS_CERTIFICATE_PWD: ${{ secrets.MACOS_CERTIFICATE_PWD }}
MACOS_KEYCHAIN_PWD: ${{ secrets.MACOS_KEYCHAIN_PWD }}
run: |
# Prepare the keychain - Based on https://localazy.com/blog/how-to-automatically-sign-macos-apps-using-github-actions
security create-keychain -p "$MACOS_KEYCHAIN_PWD" build.keychain
security default-keychain -s build.keychain
security unlock-keychain -p "$MACOS_KEYCHAIN_PWD" build.keychain
# Prepare certificate
echo "$MACOS_CERTIFICATE" | base64 --decode > certificate.p12
security import certificate.p12 -k build.keychain -P "$MACOS_CERTIFICATE_PWD" -T /usr/bin/codesign
security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k "$MACOS_KEYCHAIN_PWD" build.keychain
- name: Sign Application
shell: bash
env:
working_directory: ${{ github.workspace }}/artifacts/work
# Variables
MACOS_DEV_ID: ${{ secrets.MACOS_DEV_ID }}
MACOS_KEYCHAIN_PWD: ${{ secrets.MACOS_KEYCHAIN_PWD }}
IS_WITH_JDK: ${{ secrets.IS_WITH_JDK }}
run: |
# Unlock
security unlock-keychain -p "$MACOS_KEYCHAIN_PWD" build.keychain
unzip -q ${{ github.workspace }}/artifacts/${{ matrix.zipName }}.zip -d . && rm ${{ github.workspace }}/artifacts/*.zip
# Sign everything inside app
bash ${{ github.workspace }}/artifacts/mac-sign.sh
wget https://raw.githubusercontent.com/gama-platform/gama/$( echo $GITHUB_SHA )/ummisco.gama.product/extraresources/entitlements.plist && plutil -convert xml1 ./entitlements.plist && plutil -lint ./entitlements.plist
codesign --entitlements "./entitlements.plist" --timestamp --options=runtime --force -s "$MACOS_DEV_ID" -v ./Gama.app/Contents/MacOS/Gama
- name: Packaging signed Application w/o JDK
shell: bash
env:
working_directory: ${{ github.workspace }}/artifacts/work
# Variables
MACOS_DEV_ID: ${{ secrets.MACOS_DEV_ID }}
MACOS_KEYCHAIN_PWD: ${{ secrets.MACOS_KEYCHAIN_PWD }}
# Notarization variables
NOTARY_APPLE_ID: ${{ secrets.NOTARY_APPLE_ID }}
NOTARY_PASSWORD: ${{ secrets.NOTARY_PASSWORD }}
NOTARY_TEAM_ID: ${{ secrets.NOTARY_TEAM_ID }}
run: |
# Unlock
security unlock-keychain -p "$MACOS_KEYCHAIN_PWD" build.keychain
# Make DMG - Based on : https://developer.apple.com/forums/thread/128166
hdiutil create -verbose -srcFolder ./Gama.app -o ./${{ matrix.zipName }}.dmg
codesign -s "$MACOS_DEV_ID" --timestamp -f -v ./${{ matrix.zipName }}.dmg
# Notarize dmg - Based on : https://developer.apple.com/documentation/security/notarizing_macos_software_before_distribution/customizing_the_notarization_workflow#3087734
xcrun -v notarytool store-credentials "AC_PASSWORD" --apple-id "$NOTARY_APPLE_ID" --team-id "$NOTARY_TEAM_ID" --password "$NOTARY_PASSWORD"
xcrun -v notarytool submit ./${{ matrix.zipName }}.dmg --keychain-profile "AC_PASSWORD" --wait
xcrun -v stapler staple ./${{ matrix.zipName }}.dmg
- uses: actions/upload-artifact@v3
env:
working_directory: ${{ github.workspace }}/artifacts/work
with:
name: gama-mac-signed
path: ./${{ matrix.zipName }}.dmg
if-no-files-found: error # 'warn' or 'ignore' are also available, defaults to `warn`
#
# _ _____ _ _ _ ___ __
# | | |_ _| \ | | | | \ \ / /
# | | | | | \| | | | |\ V /
# | | | | | . ` | | | | > <
# | |____ _| |_| |\ | |__| |/ . \
# |______|_____|_| \_|\____//_/ \_\\
#
debian-archive:
# https://earthly.dev/blog/creating-and-hosting-your-own-deb-packages-and-apt-repo/#step-1-creating-a-deb-package
needs: build
if: needs.build.outputs.continue_pipeline == 'true'
runs-on: ubuntu-latest
strategy:
matrix:
zipName: [gama-platform_1.9.3-1_amd64, gama-platform-jdk_1.9.3-1_amd64]
steps:
- name: Prepare vm
run: |
sudo apt-get install -y gcc dpkg-dev gpg
mkdir -p ${{ github.workspace }}/${{ matrix.zipName }}/DEBIAN ${{ github.workspace }}/${{ matrix.zipName }}/opt/gama-platform ${{ github.workspace }}/${{ matrix.zipName }}/usr/share/applications
- uses: actions/download-artifact@v2
with:
name: gama-linux-jdk
path: ${{ github.workspace }}/${{ matrix.zipName }}/opt/gama-platform
- name: Get extra files
run: |
unzip ${{ github.workspace }}/${{ matrix.zipName }}/opt/gama-platform/extraresources-unix.zip -d ${{ github.workspace }}/${{ matrix.zipName }} && rm ${{ github.workspace }}/${{ matrix.zipName }}/opt/gama-platform/extraresources-unix.zip
mv ${{ github.workspace }}/${{ matrix.zipName }}/gama-platform.desktop ${{ github.workspace }}/${{ matrix.zipName }}/usr/share/applications/gama-platform.desktop
cd ${{ github.workspace }}/${{ matrix.zipName }}/opt/gama-platform && unzip ${{ matrix.zipName }}.zip && cd -
rm ${{ github.workspace }}/${{ matrix.zipName }}/opt/gama-platform/*.zip
- name: Tweaks for package w/ JDK
if: contains(matrix.zipName, 'jdk')
run: |
sed -i "s/gama-platform-jdk$/gama-platform/g" ${{ github.workspace }}/${{ matrix.zipName }}/DEBIAN/control
sed -i "s/Package: gama-platform$/Package: gama-platform-jdk/g" ${{ github.workspace }}/${{ matrix.zipName }}/DEBIAN/control
sed -i "/^Depends:.*$/d" ${{ github.workspace }}/${{ matrix.zipName }}/DEBIAN/control
# Pre-fix relative path for headless helper script (jdk path)
sed -i "s|headless_path=.*|headless_path=/opt/gama-platform/headless|g" ${{ github.workspace }}/${{ matrix.zipName }}/opt/gama-platform/headless/gama-headless.sh
- name: Fix relative path for headless helper script (plugin path)
run: sed -i "s/\".*\.\/p/\/opt\/gama-platform\/p/g" ${{ github.workspace }}/${{ matrix.zipName }}/opt/gama-platform/headless/gama-headless.sh
- name: Build DEB archive
run: |
dpkg --build ${{ github.workspace }}/${{ matrix.zipName }}
dpkg --info ${{ github.workspace }}/${{ matrix.zipName }}.deb
- uses: actions/upload-artifact@v3
with:
name: gama-linux-deb
path: |
${{ github.workspace }}/${{ matrix.zipName }}.deb
#
# __ _______ _ _ _____ ______ _______
# \ \ / /_ _| \ | | __ \ / __ \ \ / / ____|
# \ \ /\ / / | | | \| | | | | | | \ \ /\ / / (___
# \ \/ \/ / | | | . ` | | | | | | |\ \/ \/ / \___ \
# \ /\ / _| |_| |\ | |__| | |__| | \ /\ / ____) |
# \/ \/ |_____|_| \_|_____/ \____/ \/ \/ |_____/
#
windows-msi:
needs: build
if: needs.build.outputs.continue_pipeline == 'true'
runs-on: windows-latest
strategy:
matrix:
zipName: [Gama1.7-win32.win32.x86_64.zip, Gama1.7-win32.win32.x86_64_withJDK.zip]
steps:
- uses: actions/download-artifact@v2
with:
name: gama-windows
- name: Change variables for JDK installer
if: contains( matrix.zipName, 'withJDK')
run: |
((Get-Content -path windows_installer_script.iss -Raw) -replace 'x86_64','x86_64_withJDK') | Set-Content -Path windows_installer_script.iss
Get-Content -path windows_installer_script.iss
- name: Prepare vm
run: |
mkdir gama_output
mkdir gama_input
7z x ${{ matrix.zipName }} -ogama_input
- name: Create installer
run: iscc.exe windows_installer_script.iss
- uses: actions/upload-artifact@v3
with:
name: gama-windows-exe
path: |
gama_output
#
# ████████╗███████╗███████╗████████╗██╗███╗ ██╗ ██████╗
# ╚══██╔══╝██╔════╝██╔════╝╚══██╔══╝██║████╗ ██║██╔════╝
# ██║ █████╗ ███████╗ ██║ ██║██╔██╗ ██║██║ ███╗
# ██║ ██╔══╝ ╚════██║ ██║ ██║██║╚██╗██║██║ ██║
# ██║ ███████╗███████║ ██║ ██║██║ ╚████║╚██████╔╝
# ╚═╝ ╚══════╝╚══════╝ ╚═╝ ╚═╝╚═╝ ╚═══╝ ╚═════╝
#
macos-test-installer:
# https://earthly.dev/blog/creating-and-hosting-your-own-deb-packages-and-apt-repo/#step-1-creating-a-deb-package
needs: macOS-signing
runs-on: macos-latest
steps:
# Get Linux deb archive
- uses: actions/download-artifact@v2
with:
name: gama-mac-signed
- name: Test Gama w/ JDK
run: |
hdiutil attach ./Gama1.7-macosx.cocoa.x86_64_withJDK.dmg
cp -r /Volumes/Gama/Gama.app ~/
bash ~/Gama.app/Contents/headless/gama-headless.sh -help
rm -fr ~/Gama.app
hdiutil detach /Volumes/Gama
- name: Set up Adopt OpenJDK 17
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'
java-package: jdk
- name: Test Gama w/o JDK
run: |
hdiutil attach ./Gama1.7-macosx.cocoa.x86_64.dmg
cp -r /Volumes/Gama/Gama.app ~/
bash ~/Gama.app/Contents/headless/gama-headless.sh -help
hdiutil detach /Volumes/Gama
debian-test-installer:
# https://earthly.dev/blog/creating-and-hosting-your-own-deb-packages-and-apt-repo/#step-1-creating-a-deb-package
needs: debian-archive
runs-on: ubuntu-latest
steps:
# Get Linux deb archive
- uses: actions/download-artifact@v2
with:
name: gama-linux-deb
- name: Update apt databse
run: |
sudo apt update
- name: Install, Run & Remove (w JDK)
shell: bash
run: |
sudo apt install ./gama-platform-jdk_1.9.3-1_amd64.deb
gama-headless -help
- name: Install, Run & Remove (w/o JDK)
shell: bash
run: |
sudo apt install -y ./gama-platform_1.9.3-1_amd64.deb
# Switch to OpenJDK 17
sudo update-java-alternatives -s $(update-java-alternatives -l | grep "\-openjdk" | cut -d " " -f 1)
java -version
gama-headless -help
sudo apt remove -y gama-platform
#
# ██████╗ ██╗ ██╗██████╗ ██╗ ██╗███████╗██╗ ██╗██╗███╗ ██╗ ██████╗
# ██╔══██╗██║ ██║██╔══██╗██║ ██║██╔════╝██║ ██║██║████╗ ██║██╔════╝
# ██████╔╝██║ ██║██████╔╝██║ ██║███████╗███████║██║██╔██╗ ██║██║ ███╗
# ██╔═══╝ ██║ ██║██╔══██╗██║ ██║╚════██║██╔══██║██║██║╚██╗██║██║ ██║
# ██║ ╚██████╔╝██████╔╝███████╗██║███████║██║ ██║██║██║ ╚████║╚██████╔╝
# ╚═╝ ╚═════╝ ╚═════╝ ╚══════╝╚═╝╚══════╝╚═╝ ╚═╝╚═╝╚═╝ ╚═══╝ ╚═════╝
#
#
# Github releasing
#
publish-archives:
needs: [macos-test-installer, debian-test-installer, windows-msi]
name: Publish archives to Github Releases
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
# Get zip archives
- uses: actions/download-artifact@v2
with:
name: gama-zip-builds
# Get Mac dmg signed archives
- uses: actions/download-artifact@v2
with:
name: gama-mac-signed
# Get Linux deb archive
- uses: actions/download-artifact@v2
with:
name: gama-linux-deb
# Get Linux deb archive
- uses: actions/download-artifact@v2
with:
name: gama-windows-exe
- name: Set Travis env
run: |
if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
echo "[WARNING] Forcing travis version release"
echo "TRAVIS_MSG=ci release" >> $GITHUB_ENV
else
echo "TRAVIS_MSG=$(echo $github.event.head_commit.message )" >> $GITHUB_ENV
fi
echo $TRAVIS_MSG
- name: Get travis scripts ready to use
run: |
# Get full travis script folder
chmod +x ./travis/*
# Debug
ls -lah ${{ github.workspace }}
- name: Create/Update tag
uses: rickstaa/action-create-tag@v1.6.3
with:
tag: 1.9.3
force_push_tag: true
- name: Setup new release data and rename files accordingly
id: setup_new_release_data
run: |
commit=$(git rev-parse --short=7 HEAD)
echo "commit=$commit" >> "$GITHUB_OUTPUT"
date=$(date +'%d/%m/%y %R')
timestamp="$(echo $date | cut -d' ' -f1 | sed 's|/|.|g')"
echo "date=$date" >> "$GITHUB_OUTPUT"
mkdir ${{ runner.temp }}/files
mv *.zip *.deb *.dmg *.exe ${{ runner.temp }}/files
cd ${{ runner.temp }}/files
# Add naming file depending on if current file is pre-release or not
fileNameExtension=_${timestamp}_${commit}
if [[ "${{ inputs.is_release }}" == "true" ]]; then
fileNameExtension=""
fi
# Windows
for file in *.exe *win32*.zip; do
if [[ "$(echo $file | awk -F'_' '{print $NF}')" == *"withJDK"* ]]; then
mv -v "$file" "GAMA_1.9.3_Windows_with_JDK${fileNameExtension}.$(echo $file | awk -F'.' '{print $NF}')"
else
mv -v "$file" "GAMA_1.9.3_Windows${fileNameExtension}.$(echo $file | awk -F'.' '{print $NF}')"
fi
done
# Mac
for file in *.dmg; do
prefix="_${fileNameExtension}.dmg"
if [[ "$(echo $file | awk -F'_' '{print $NF}')" == *"withJDK"* ]]; then
prefix="_with_JDK${prefix}"
fi
if [[ "$file" == *"aarch64"* ]]; then
prefix="_M1${prefix}"
fi
prefix="GAMA_1.9.3_MacOS${prefix}"
mv -v $file $prefix
done
# Linux
for file in *.deb gama-platform*.zip; do
if [[ "$(echo $file | awk -F'_' '{print $1}')" == *"jdk"* ]]; then
mv -v "$file" "GAMA_1.9.3_Linux_with_JDK${fileNameExtension}.$(echo $file | awk -F'.' '{print $NF}')"
else
mv -v "$file" "GAMA_1.9.3_Linux${fileNameExtension}.$(echo $file | awk -F'.' '{print $NF}')"
fi
done
- name: Delete old release
uses: cb80/delrel@v0.16.0
with:
tag: 1.9.3
token: ${{ secrets.BOT_TOKEN }}
- name: Publish alpha to Github
uses: svenstaro/upload-release-action@2.7.0
if: "${{ github.event.inputs.is_release == 'false' }}"
with:
body: |
Alpha release for GAMA 1.9.3, which adds compatibility with JDK 17. Please test and report issues
Last updated on ${{ steps.setup_new_release_data.outputs.date }}.
file: ${{ runner.temp }}/files/*
file_glob: true
make_latest: false
promote: false
prerelease: true
release_name: Alpha Version 1.9.3 (${{ steps.setup_new_release_data.outputs.commit }})
tag: 1.9.3
repo_token: ${{ secrets.BOT_TOKEN }}
- name: Publish stable to Github
uses: svenstaro/upload-release-action@2.7.0
if: "${{ github.event.inputs.is_release == 'true' }}"
with:
body: |
Release for GAMA 1.9.3.
Published on ${{ steps.setup_new_release_data.outputs.date }}.
file: ${{ runner.temp }}/files/*
file_glob: true
make_latest: true
promote: true
prerelease: false
release_name: Version 1.9.3
tag: 1.9.3
repo_token: ${{ secrets.BOT_TOKEN }}
#
# Publishing to 3rd party
#
publishing-third-party:
needs: publish-archives
name: Publish archives to 3rd parties
uses: ./.github/workflows/publish-to-third-party.yml
with:
tag: 1.9.3
secrets:
BOT_TOKEN: ${{ secrets.BOT_TOKEN }}