-
Notifications
You must be signed in to change notification settings - Fork 3
675 lines (595 loc) · 22.9 KB
/
build.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
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
name: Build CREXX
on: [push]
jobs:
#**************************************************#
build-ubuntu:
name: Build for Ubuntu
runs-on: [ubuntu-latest]
steps:
- name: Determine Release Name
run: |
if [[ "${{ github.ref }}" == refs/tags/* ]]; then
echo "RELEASE_ID=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
elif [[ "${{ github.ref }}" == refs/heads/develop ]]; then
echo "RELEASE_ID=dev-snapshot" >> $GITHUB_ENV
elif [[ "${{ github.ref }}" =~ ^refs/heads/feature/.*$ ]]; then
echo "RELEASE_ID=${GITHUB_REF#refs/heads/feature/}" >> $GITHUB_ENV
else
echo "Skip release"
fi
- name: Get Regina
run: |
sudo apt-get install --no-install-recommends -y regina-rexx
shell: bash
- name: Checkout
uses: actions/checkout@v3
with:
submodules: 'recursive'
- name: CMAKE Build Debug
uses: lukka/run-cmake@v3
with:
# Select the build configuration, typically Debug or Release.
cmakeBuildType: Debug # optional, default is Debug
buildDirectory: "${{ runner.temp }}/debug"
- name: CMAKE Build Release
uses: lukka/run-cmake@v3
with:
# Select the build configuration, typically Debug or Release.
cmakeBuildType: MinSizeRel # optional, default is Debug
buildDirectory: "${{ runner.temp }}/release"
- name: Get Executables
run: |
mkdir -p "${{ runner.temp }}/exe"
mkdir -p "${{ runner.temp }}/exe/release"
mkdir -p "${{ runner.temp }}/exe/debug"
cp "${{ runner.temp }}/release/compiler/rxc" "${{ runner.temp }}/exe/release"
cp "${{ runner.temp }}/release/assembler/rxas" "${{ runner.temp }}/exe/release"
cp "${{ runner.temp }}/release/disassembler/rxdas" "${{ runner.temp }}/exe/release"
cp "${{ runner.temp }}/release/debugger/rxdb" "${{ runner.temp }}/exe/release"
cp "${{ runner.temp }}/release/interpreter/rxvm" "${{ runner.temp }}/exe/release"
cp "${{ runner.temp }}/release/interpreter/rxbvm" "${{ runner.temp }}/exe/release"
cp "${{ runner.temp }}/release/interpreter/rxvme" "${{ runner.temp }}/exe/release"
cp "${{ runner.temp }}/release/interpreter/rxbvme" "${{ runner.temp }}/exe/release"
cp "${{ runner.temp }}/release/interpreter/librxbvml.a" "${{ runner.temp }}/exe/release"
cp "${{ runner.temp }}/release/interpreter/librxvml.a" "${{ runner.temp }}/exe/release"
cp "${{ runner.temp }}/debug/compiler/rxc" "${{ runner.temp }}/exe/debug"
cp "${{ runner.temp }}/debug/assembler/rxas" "${{ runner.temp }}/exe/debug"
cp "${{ runner.temp }}/debug/disassembler/rxdas" "${{ runner.temp }}/exe/debug"
cp "${{ runner.temp }}/debug/debugger/rxdb" "${{ runner.temp }}/exe/debug"
cp "${{ runner.temp }}/debug/interpreter/rxvm" "${{ runner.temp }}/exe/debug"
cp "${{ runner.temp }}/debug/interpreter/rxbvm" "${{ runner.temp }}/exe/debug"
cp "${{ runner.temp }}/debug/interpreter/rxvme" "${{ runner.temp }}/exe/debug"
cp "${{ runner.temp }}/debug/interpreter/rxbvme" "${{ runner.temp }}/exe/debug"
cp "${{ runner.temp }}/debug/interpreter/librxbvml.a" "${{ runner.temp }}/exe/debug"
cp "${{ runner.temp }}/debug/interpreter/librxvml.a" "${{ runner.temp }}/exe/debug"
cp LICENSE "${{ runner.temp }}/exe"
cp README.md "${{ runner.temp }}/exe"
cp SECURITY.md "${{ runner.temp }}/exe"
cp history.txt "${{ runner.temp }}/exe"
shell: bash
- name: Sanity Check
working-directory: ${{ runner.temp }}/exe
run: |
./release/rxc -v
./release/rxas -v
./release/rxdas -v
./release/rxdb -v
./release/rxvm -v
./release/rxbvm -v
./release/rxvme -v
./release/rxbvme -v
./debug/rxc -v
./debug/rxas -v
./debug/rxdas -v
./debug/rxdb -v
./debug/rxvm -v
./debug/rxbvm -v
./debug/rxvme -v
./debug/rxbvme -v
shell: bash
- name: Build CMS lexers
run: |
${{ runner.temp }}/release/re2c/re2c -I S370 -o S370/rxasscan.c assembler/rxasscan.re
${{ runner.temp }}/release/re2c/re2c -I S370 -o S370/rxcposcn.c compiler/rxcposcn.re
${{ runner.temp }}/release/re2c/re2c -I S370 -o S370/rexbscan.c compiler/rxcpbscn.re
shell: bash
- name: Upload Executable
if: env.RELEASE_ID
uses: actions/upload-artifact@v4
with:
name: CREXX-Ubuntu
path: |
${{ runner.temp }}/exe
${{ runner.temp }}/exe/debug
${{ runner.temp }}/exe/release
- name: Upload instrmiss.h
uses: actions/upload-artifact@v4
with:
name: instrmiss.h
path: ${{ runner.temp }}/release/machine/instrmiss.h
- name: Upload instrset.h
uses: actions/upload-artifact@v4
with:
name: instrset.h
path: ${{ runner.temp }}/release/machine/instrset.h
- name: Upload rxasscan.c
uses: actions/upload-artifact@v4
with:
name: rxasscan.c
path: ${{ runner.temp }}/release/assembler/rxasscan.c
- name: Upload rxasscan.c.s370
uses: actions/upload-artifact@v4
with:
name: rxasscan.c.s370
path: S370/rxasscan.c
- name: Upload rxasgrmr.c
uses: actions/upload-artifact@v4
with:
name: rxasgrmr.c
path: ${{ runner.temp }}/release/assembler/rxasgrmr.c
- name: Upload rxasgrmr.h
uses: actions/upload-artifact@v4
with:
name: rxasgrmr.h
path: ${{ runner.temp }}/release/assembler/rxasgrmr.h
- name: Upload rxcposcn.c
uses: actions/upload-artifact@v4
with:
name: rxcposcn.c
path: ${{ runner.temp }}/release/compiler/rxcposcn.c
- name: Upload rxcposcn.c.s370
uses: actions/upload-artifact@v4
with:
name: rxcposcn.c.s370
path: S370/rxcposcn.c
- name: Upload rxcpopgr.c
uses: actions/upload-artifact@v4
with:
name: rxcpopgr.c
path: ${{ runner.temp }}/release/compiler/rxcpopgr.c
- name: Upload rxcpopgr.h
uses: actions/upload-artifact@v4
with:
name: rxcpopgr.h
path: ${{ runner.temp }}/release/compiler/rxcpopgr.h
- name: Upload rexbscan.c
uses: actions/upload-artifact@v4
with:
name: rexbscan.c
path: ${{ runner.temp }}/release/compiler/rexbscan.c
- name: Upload rexbscan.c.s370
uses: actions/upload-artifact@v4
with:
name: rexbscan.c.s370
path: S370/rexbscan.c
- name: Upload rxcpbgmr.c
uses: actions/upload-artifact@v4
with:
name: rxcpbgmr.c
path: ${{ runner.temp }}/release/compiler/rxcpbgmr.c
- name: Upload rxcpbgmr.h
uses: actions/upload-artifact@v4
with:
name: rxcpbgmr.h
path: ${{ runner.temp }}/release/compiler/rxcpbgmr.h
#**************************************************#
build-cms:
name: Build for CMS
runs-on: [ubuntu-latest]
needs: [build-ubuntu]
container: adriansutherland/vm370:builder
steps:
- name: Determine Release Name
run: |
if [[ "${{ github.ref }}" == refs/tags/* ]]; then
echo "RELEASE_ID=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
elif [[ "${{ github.ref }}" == refs/heads/develop ]]; then
echo "RELEASE_ID=dev_snapshot" >> $GITHUB_ENV
elif [[ "${{ github.ref }}" =~ ^refs/heads/feature/.*$ ]]; then
echo "RELEASE_ID=${GITHUB_REF#refs/heads/feature/}" >> $GITHUB_ENV
else
echo "Skip release"
fi
shell: bash
- name: Checkout
uses: actions/checkout@v3
- name: Download instrmiss.h
uses: actions/download-artifact@v4
with:
name: instrmiss.h
path: machine
- name: Download instrset.h
uses: actions/download-artifact@v4
with:
name: instrset.h
path: machine
- name: Download rxasscan.c.s370
uses: actions/download-artifact@v4
with:
name: rxasscan.c.s370
path: S370
- name: Download rxasgrmr.c
uses: actions/download-artifact@v4
with:
name: rxasgrmr.c
path: assembler
- name: Download rxasgrmr.h
uses: actions/download-artifact@v4
with:
name: rxasgrmr.h
path: assembler
- name: Download rxcposcn.c.s370
uses: actions/download-artifact@v4
with:
name: rxcposcn.c.s370
path: S370
- name: Download rxcpopgr.c
uses: actions/download-artifact@v4
with:
name: rxcpopgr.c
path: compiler
- name: Download rxcpopgr.h
uses: actions/download-artifact@v4
with:
name: rxcpopgr.h
path: compiler
- name: Download rexbscan.c.s370
uses: actions/download-artifact@v4
with:
name: rexbscan.c.s370
path: S370
- name: Download rxcpbgmr.c
uses: actions/download-artifact@v4
with:
name: rxcpbgmr.c
path: compiler
- name: Download rxcpbgmr.h
uses: actions/download-artifact@v4
with:
name: rxcpbgmr.h
path: compiler
- name: Move Source
run: |
mkdir /opt/hercules/vm370/io
mv * /opt/hercules/vm370/io
shell: bash
- name: Build
working-directory: /opt/hercules/vm370
run: |
chmod -R ugo+rw *
hercules -f hercules.conf -d >/dev/null 2>/dev/null &
cd io/S370
chmod +x *.sh
echo "Running CMSBUILD"
./cmsbuild.sh
shell: bash
- name: Get Executable
run: |
mkdir -p exe
cp /opt/hercules/vm370/io/crexxbin.aws exe
cp /opt/hercules/vm370/io/crexxsrc.aws exe
cp /opt/hercules/vm370/io/crexxbin.vmarc exe
cp /opt/hercules/vm370/io/crexxsrc.vmarc exe
cp /opt/hercules/vm370/io/LICENSE exe
cp /opt/hercules/vm370/io/README.md exe
cp /opt/hercules/vm370/io/SECURITY.md exe
cp /opt/hercules/vm370/io/S370/cmsinstall.sh exe
cp /opt/hercules/vm370/io/history.txt exe
chmod -R ugo+r exe
shell: bash
- name: Upload Executable
if: env.RELEASE_ID
uses: actions/upload-artifact@v4
with:
name: CREXX-CMS
path: ./exe
#**************************************************#
build-windows:
name: Build for Windows
runs-on: [windows-latest]
needs: [build-ubuntu]
steps:
- name: Update Toolchain (MSYS2)
uses: msys2/setup-msys2@v2
with:
update: true
install: >-
base-devel
git
make
pacboy: >-
toolchain:p
cmake:p
ninja:p
- name: Determine Release Name
run: |
if [[ "${{ github.ref }}" == refs/tags/* ]]; then
echo "RELEASE_ID=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
elif [[ "${{ github.ref }}" == refs/heads/develop ]]; then
echo "RELEASE_ID=dev_snapshot" >> $GITHUB_ENV
elif [[ "${{ github.ref }}" =~ ^refs/heads/feature/.*$ ]]; then
echo "RELEASE_ID=${GITHUB_REF#refs/heads/feature/}" >> $GITHUB_ENV
else
echo "Skip release"
fi
shell: bash
- name: Checkout
uses: actions/checkout@v3
with:
submodules: 'recursive'
- name: Download instrmiss.h
uses: actions/download-artifact@v4
with:
name: instrmiss.h
path: machine
- name: Download instrset.h
uses: actions/download-artifact@v4
with:
name: instrset.h
path: machine
- name: Build Debug
shell: msys2 {0}
run: |
cmake -G Ninja -B "${{ runner.temp }}/debug" -DCMAKE_BUILD_TYPE=Debug
cmake --build "${{ runner.temp }}/debug"
- name: Build Release
shell: msys2 {0}
run: |
cmake -G Ninja -B "${{ runner.temp }}/release" -DCMAKE_BUILD_TYPE=MinSizeRel
cmake --build "${{ runner.temp }}/release"
- name: Get Executable
run: |
mkdir -p "${{ runner.temp }}/exe"
mkdir -p "${{ runner.temp }}/exe/release"
mkdir -p "${{ runner.temp }}/exe/debug"
cp "${{ runner.temp }}/release/compiler/rxc.exe" "${{ runner.temp }}/exe/release"
cp "${{ runner.temp }}/release/assembler/rxas.exe" "${{ runner.temp }}/exe/release"
cp "${{ runner.temp }}/release/disassembler/rxdas.exe" "${{ runner.temp }}/exe/release"
cp "${{ runner.temp }}/release/debugger/rxdb.exe" "${{ runner.temp }}/exe/release"
cp "${{ runner.temp }}/release/interpreter/rxvm.exe" "${{ runner.temp }}/exe/release"
cp "${{ runner.temp }}/release/interpreter/rxbvm.exe" "${{ runner.temp }}/exe/release"
cp "${{ runner.temp }}/release/interpreter/rxvme.exe" "${{ runner.temp }}/exe/release"
cp "${{ runner.temp }}/release/interpreter/rxbvme.exe" "${{ runner.temp }}/exe/release"
cp "${{ runner.temp }}/release/interpreter/librxbvml.a" "${{ runner.temp }}/exe/release"
cp "${{ runner.temp }}/release/interpreter/librxvml.a" "${{ runner.temp }}/exe/release"
cp "${{ runner.temp }}/debug/compiler/rxc.exe" "${{ runner.temp }}/exe/debug"
cp "${{ runner.temp }}/debug/assembler/rxas.exe" "${{ runner.temp }}/exe/debug"
cp "${{ runner.temp }}/debug/disassembler/rxdas.exe" "${{ runner.temp }}/exe/debug"
cp "${{ runner.temp }}/debug/debugger/rxdb.exe" "${{ runner.temp }}/exe/debug"
cp "${{ runner.temp }}/debug/interpreter/rxvm.exe" "${{ runner.temp }}/exe/debug"
cp "${{ runner.temp }}/debug/interpreter/rxbvm.exe" "${{ runner.temp }}/exe/debug"
cp "${{ runner.temp }}/debug/interpreter/rxvme.exe" "${{ runner.temp }}/exe/debug"
cp "${{ runner.temp }}/debug/interpreter/rxbvme.exe" "${{ runner.temp }}/exe/debug"
cp "${{ runner.temp }}/debug/interpreter/librxbvml.a" "${{ runner.temp }}/exe/debug"
cp "${{ runner.temp }}/debug/interpreter/librxvml.a" "${{ runner.temp }}/exe/debug"
cp LICENSE "${{ runner.temp }}/exe"
cp README.md "${{ runner.temp }}/exe"
cp SECURITY.md "${{ runner.temp }}/exe"
cp history.txt "${{ runner.temp }}/exe"
shell: bash
- name: Sanity Check
working-directory: ${{ runner.temp }}/exe
run: |
./release/rxc -v
./release/rxas -v
./release/rxdas -v
./release/rxdb -v
./release/rxvm -v
./release/rxbvm -v
./release/rxvme -v
./release/rxbvme -v
./debug/rxc -v
./debug/rxas -v
./debug/rxdas -v
./debug/rxdb -v
./debug/rxvm -v
./debug/rxbvm -v
./debug/rxvme -v
./debug/rxbvme -v
shell: bash
- name: Upload Executable
if: env.RELEASE_ID
uses: actions/upload-artifact@v4
with:
name: CREXX-Windows
path: |
${{ runner.temp }}/exe
${{ runner.temp }}/exe/debug
${{ runner.temp }}/exe/release
#**************************************************#
build-macos:
name: Build for MacOS
runs-on: [macos-latest]
needs: [build-ubuntu]
steps:
- name: Determine Release Name
run: |
if [[ "${{ github.ref }}" == refs/tags/* ]]; then
echo "RELEASE_ID=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
elif [[ "${{ github.ref }}" == refs/heads/develop ]]; then
echo "RELEASE_ID=dev_snapshot" >> $GITHUB_ENV
elif [[ "${{ github.ref }}" =~ ^refs/heads/feature/.*$ ]]; then
echo "RELEASE_ID=${GITHUB_REF#refs/heads/feature/}" >> $GITHUB_ENV
else
echo "Skip release"
fi
- name: Checkout
uses: actions/checkout@v3
with:
submodules: 'recursive'
- name: Download instrmiss.h
uses: actions/download-artifact@v4
with:
name: instrmiss.h
path: machine
- name: Download instrset.h
uses: actions/download-artifact@v4
with:
name: instrset.h
path: machine
- name: CMAKE Build Debug
uses: lukka/run-cmake@v3
with:
# Select the build configuration, typically Debug or Release.
cmakeBuildType: Debug # optional, default is Debug
buildDirectory: "${{ runner.temp }}/debug"
- name: CMAKE Build Release
uses: lukka/run-cmake@v3
with:
# Select the build configuration, typically Debug or Release.
cmakeBuildType: MinSizeRel # optional, default is Debug
buildDirectory: "${{ runner.temp }}/release"
- name: Get Executable
run: |
mkdir -p "${{ runner.temp }}/exe"
mkdir -p "${{ runner.temp }}/exe/release"
mkdir -p "${{ runner.temp }}/exe/debug"
cp "${{ runner.temp }}/release/compiler/rxc" "${{ runner.temp }}/exe/release"
cp "${{ runner.temp }}/release/assembler/rxas" "${{ runner.temp }}/exe/release"
cp "${{ runner.temp }}/release/disassembler/rxdas" "${{ runner.temp }}/exe/release"
cp "${{ runner.temp }}/release/debugger/rxdb" "${{ runner.temp }}/exe/release"
cp "${{ runner.temp }}/release/interpreter/rxvm" "${{ runner.temp }}/exe/release"
cp "${{ runner.temp }}/release/interpreter/rxbvm" "${{ runner.temp }}/exe/release"
cp "${{ runner.temp }}/release/interpreter/rxvme" "${{ runner.temp }}/exe/release"
cp "${{ runner.temp }}/release/interpreter/rxbvme" "${{ runner.temp }}/exe/release"
cp "${{ runner.temp }}/release/interpreter/librxbvml.a" "${{ runner.temp }}/exe/release"
cp "${{ runner.temp }}/release/interpreter/librxvml.a" "${{ runner.temp }}/exe/release"
cp "${{ runner.temp }}/debug/compiler/rxc" "${{ runner.temp }}/exe/debug"
cp "${{ runner.temp }}/debug/assembler/rxas" "${{ runner.temp }}/exe/debug"
cp "${{ runner.temp }}/debug/disassembler/rxdas" "${{ runner.temp }}/exe/debug"
cp "${{ runner.temp }}/debug/debugger/rxdb" "${{ runner.temp }}/exe/debug"
cp "${{ runner.temp }}/debug/interpreter/rxvm" "${{ runner.temp }}/exe/debug"
cp "${{ runner.temp }}/debug/interpreter/rxbvm" "${{ runner.temp }}/exe/debug"
cp "${{ runner.temp }}/debug/interpreter/rxvme" "${{ runner.temp }}/exe/debug"
cp "${{ runner.temp }}/debug/interpreter/rxbvme" "${{ runner.temp }}/exe/debug"
cp "${{ runner.temp }}/debug/interpreter/librxbvml.a" "${{ runner.temp }}/exe/debug"
cp "${{ runner.temp }}/debug/interpreter/librxvml.a" "${{ runner.temp }}/exe/debug"
cp LICENSE "${{ runner.temp }}/exe"
cp README.md "${{ runner.temp }}/exe"
cp SECURITY.md "${{ runner.temp }}/exe"
cp history.txt "${{ runner.temp }}/exe"
shell: bash
- name: Sanity Check
working-directory: ${{ runner.temp }}/exe
run: |
./release/rxc -v
./release/rxas -v
./release/rxdas -v
./release/rxdb -v
./release/rxvm -v
./release/rxbvm -v
./release/rxvme -v
./release/rxbvme -v
./debug/rxc -v
./debug/rxas -v
./debug/rxdas -v
./debug/rxdb -v
./debug/rxvm -v
./debug/rxbvm -v
./debug/rxvme -v
./debug/rxbvme -v
shell: bash
- name: Upload Executable
if: env.RELEASE_ID
uses: actions/upload-artifact@v4
with:
name: CREXX-MacOS
path: |
${{ runner.temp }}/exe
${{ runner.temp }}/exe/debug
${{ runner.temp }}/exe/release
#**************************************************#
release:
name: Release
needs: [build-ubuntu, build-windows, build-cms, build-macos]
runs-on: [ubuntu-latest]
steps:
- name: Determine Release Name
run: |
if [[ "${{ github.ref }}" == refs/tags/* ]]; then
echo "RELEASE_ID=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
elif [[ "${{ github.ref }}" == refs/heads/develop ]]; then
echo "RELEASE_ID=dev_snapshot" >> $GITHUB_ENV
elif [[ "${{ github.ref }}" =~ ^refs/heads/feature/.*$ ]]; then
echo "RELEASE_ID=${GITHUB_REF#refs/heads/feature/}" >> $GITHUB_ENV
else
echo "Skip release"
fi
- name: Checkout
if: env.RELEASE_ID
uses: actions/checkout@v3
- name: Checkout branch and push tag
if: env.RELEASE_ID
run: |
git config --global user.name 'github-actions'
git config --global user.email '[email protected]'
git tag -f ${{ env.RELEASE_ID }}
git push -f origin ${{ env.RELEASE_ID }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Get CMS binary
if: env.RELEASE_ID
uses: actions/download-artifact@v4
with:
name: CREXX-CMS
path: CREXX-CMS
- name: ZIP CMS binary
run:
zip -r CREXX-CMS.zip CREXX-CMS
- name: Get ubuntu binary
if: env.RELEASE_ID
uses: actions/download-artifact@v4
with:
name: CREXX-Ubuntu
path: CREXX-Ubuntu
- name: ZIP ubuntu binary
if: env.RELEASE_ID
run:
zip -r CREXX-Ubuntu.zip CREXX-Ubuntu
- name: Get windows binary
if: env.RELEASE_ID
uses: actions/download-artifact@v4
with:
name: CREXX-Windows
path: CREXX-Windows
- name: ZIP windows binary
if: env.RELEASE_ID
run:
zip -r CREXX-Windows.zip CREXX-Windows
- name: Get MacOS binary
if: env.RELEASE_ID
uses: actions/download-artifact@v4
with:
name: CREXX-MacOS
path: CREXX-MacOS
- name: ZIP MacOS binary
if: env.RELEASE_ID
run:
zip -r CREXX-MacOS.zip CREXX-MacOS
- name: Delete old release assets
if: env.RELEASE_ID
uses: mknejp/delete-release-assets@v1
with:
tag: ${{ env.RELEASE_ID }}
token: ${{ github.token }}
fail-if-no-release: false
fail-if-no-assets: false
assets: |
*.zip
*.gz
- name: Create Release and Upload Assets
id: create_release
if: env.RELEASE_ID
uses: softprops/action-gh-release@v1
with:
files: |
./CREXX-CMS.zip
./CREXX-Ubuntu.zip
./CREXX-Windows.zip
./CREXX-MacOS.zip
name: Snapshot ${{ env.RELEASE_ID }}
tag_name: ${{ env.RELEASE_ID }}
draft: false
prerelease: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}