forked from mit-plv/fiat-crypto
-
Notifications
You must be signed in to change notification settings - Fork 1
655 lines (611 loc) · 24.7 KB
/
coq.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
name: CI (Coq)
on:
push:
branches: [ master , sp2019latest , v8.6 , v8.8 , v8.10 ]
pull_request:
merge_group:
workflow_dispatch:
release:
types: [published]
schedule:
- cron: '0 0 1 * *'
jobs:
build:
strategy:
fail-fast: false
matrix:
include:
- name: 'docker-master'
container: {name: 'coqorg/coq', image: 'coqorg/coq:dev'}
env: { ALLOW_DIFF: "1" }
make: 'etc/ci/github-actions-make.sh --warnings'
raw-make: 'make'
sudo-make: 'sudo make'
coqbin-arg: 'COQBIN="$(dirname "$(which coqc)")/"'
os: {name: 'Ubuntu', runs-on: 'ubuntu-latest'}
- name: 'alpine-edge'
container: {name: 'alpine', image: 'alpine:edge'}
env: { CAMLEXTRAFLAGS="-ccopt -static" }
make: 'etc/ci/github-actions-make.sh'
raw-make: 'make'
sudo-make: 'sudo make'
coqbin-arg: 'COQBIN="$(dirname "$(which coqc)")/"'
os: {name: 'Ubuntu', runs-on: 'ubuntu-latest'}
- name: 'archlinux'
container: {name: 'archlinux', image: 'archlinux'}
make: 'etc/ci/github-actions-make.sh'
raw-make: 'make'
sudo-make: 'sudo make'
coqbin-arg: 'COQBIN="$(dirname "$(which coqc)")/"'
os: {name: 'Ubuntu', runs-on: 'ubuntu-latest'}
- name: 'debian-sid'
container: {name: 'debian', image: 'debian:sid'}
make: 'etc/ci/github-actions-make.sh'
raw-make: 'make'
sudo-make: 'sudo make'
coqbin-arg: 'COQBIN="$(dirname "$(which coqc)")/"'
os: {name: 'Ubuntu', runs-on: 'ubuntu-latest'}
- name: 'windows'
coq-version: '8.17.0' # minimal major version required for bedrock2 components
os: {name: 'Windows', runs-on: 'windows-latest'}
env: { COQEXTRAFLAGS: "-async-proofs-j 1", COQCHKEXTRAFLAGS: "", OPAMYES: "true", OPAMCONFIRMLEVEL: "unsafe-yes" }
extra-ocaml-repositories: 'opam-repository-mingw: https://github.com/ocaml-opam/opam-repository-mingw.git#sunset'
make: 'opam exec -- etc/ci/github-actions-make.sh'
raw-make: 'opam exec -- make'
sudo-make: 'opam exec -- make'
container: {name: '', image: '', ocaml-compiler: '4.11.1'}
- name: 'macos'
coq-version: '8.18.0' # pick a version not tested on other platforms
os: {name: 'macOS', runs-on: 'macos-latest'}
env: { COQCHKEXTRAFLAGS: "", SKIP_BEDROCK2: "0", OPAMYES: "true", OPAMCONFIRMLEVEL: "unsafe-yes" }
make: 'etc/ci/github-actions-make.sh'
raw-make: 'make'
sudo-make: 'make'
container: {name: '', image: '', ocaml-compiler: '4.11.1'}
runs-on: ${{ matrix.os.runs-on }}
env: ${{ matrix.env }}
name: ${{ matrix.name }}
container: ${{ matrix.container.image }}
concurrency:
group: ${{ github.workflow }}-${{ matrix.name }}-${{ matrix.os }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
steps:
- run: echo ::add-matcher::.github/make.json
- name: Install System Dependencies (Alpine)
run: apk add git make jq gcc musl-dev python3 ocaml ocaml-findlib ghc cabal coq ocaml-zarith bash sudo
if: matrix.container.name == 'alpine'
- name: Install System Dependencies (Debian)
run: |
apt-get -o Acquire::Retries=30 update -y
apt-get -q -y --allow-unauthenticated -o Acquire::Retries=30 install sudo git make time jq python3 python-is-python3 ocaml coq libcoq-core-ocaml-dev libfindlib-ocaml-dev ocaml-findlib cabal-install js-of-ocaml
if: matrix.container.name == 'debian'
- name: Install System Dependencies (Arch Linux)
run: |
pacman --noconfirm -Syu base-devel git make python3 which jq ghc ghc-static time diffutils coq ocaml-zarith --needed
if: matrix.container.name == 'archlinux'
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Set up OCaml
uses: ocaml/setup-ocaml@v2
with:
ocaml-compiler: ${{ matrix.container.ocaml-compiler }}
opam-repositories: |-
${{ matrix.os.extra-ocaml-repositories }}
default: https://github.com/ocaml/opam-repository.git
if: matrix.container.name == ''
- run: eval $(opam env)
if: matrix.container.name == '' || matrix.container.name == 'coqorg/coq'
- run: opam update
if: matrix.container.name == ''
- run: opam depext coq.${{ matrix.coq-version }}
if: matrix.container.name == ''
- run: opam pin add --kind=version coq ${{ matrix.coq-version }}
if: matrix.container.name == ''
- run: opam install js_of_ocaml
if: matrix.container.name == '' || matrix.container.name == 'coqorg/coq'
- name: Install System Dependencies (Windows)
run: |
%CYGWIN_ROOT%\setup-x86_64.exe -qnNdO -P time,zip
shell: cmd
if: matrix.os.name == 'Windows'
- name: Install System Dependencies (coqorg/coq)
run: |
sudo apt-get -o Acquire::Retries=30 update -y
sudo apt-get -o Acquire::Retries=30 install -y --allow-unauthenticated python python3 bsdmainutils
if: matrix.container.name == 'coqorg/coq'
- name: Install system dependencies (MacOS)
run: |
set -e
brew install gnu-time coreutils
if: matrix.os.name == 'macOS'
- name: Work around https://github.com/actions/checkout/issues/766 (Windows)
run: %CYGWIN_ROOT%\bin\bash.exe -l -c 'git config --global --add safe.directory "*"'
shell: cmd
if: matrix.os.name == 'Windows'
- name: Work around https://github.com/actions/checkout/issues/766 (Linux)
run: git config --global --add safe.directory "*"
if: matrix.container.name != ''
- name: Update permissions (coqorg/coq)
run: sudo chmod -R a=u .
if: matrix.container.name == 'coqorg/coq'
- name: work around coq issue 15663 (Alpine & Arch Linux)
run: |
ln -s /usr/lib/coq /usr/lib/ocaml/coq
ln -s /usr/lib/coq-core /usr/lib/ocaml/coq-core
ln -s /usr/lib/coqide-server /usr/lib/ocaml/coqide-server
if: matrix.container.name == 'alpine' || matrix.container.name == 'archlinux'
- name: echo build params (Linux)
run: etc/ci/describe-system-config.sh
if: matrix.os.name == 'Ubuntu'
- name: echo build params (Windows)
run: %cd%\etc\ci\describe-system-config-win.bat
shell: cmd
if: matrix.os.name == 'Windows'
- name: echo build params (MacOS)
run: |
eval $(opam env)
etc/ci/describe-system-config-macos.sh
if: matrix.os.name == 'macOS'
- name: deps
run: ${{ matrix.make }} -j2 ${{ matrix.coqbin-arg }} deps
- name: all-except-generated-and-js-of-ocaml
run: ${{ matrix.make }} -j2 all-except-generated-and-js-of-ocaml
- name: pre-standalone-extracted
run: ${{ matrix.make }} -j2 pre-standalone-extracted
- name: upload OCaml files
uses: actions/upload-artifact@v4
with:
name: ExtractionOCaml-${{ matrix.name }}
path: src/ExtractionOCaml
if: always ()
- name: upload js_of_ocaml source files
uses: actions/upload-artifact@v4
with:
name: ExtractionJsOfOCaml-source-${{ matrix.name }}
path: src/ExtractionJsOfOCaml
if: always ()
- name: upload Haskell source files
uses: actions/upload-artifact@v4
with:
name: ExtractionHaskell-source-${{ matrix.name }}
path: src/ExtractionHaskell
if: always ()
- name: install-standalone-unified-ocaml
run: ${{ matrix.raw-make }} -f Makefile.standalone install-standalone-unified-ocaml BINDIR=dist
- name: upload standalone files
uses: actions/upload-artifact@v4
with:
name: standalone-${{ matrix.name }}
path: dist/fiat_crypto
- run: git config --file .gitmodules --get-regexp path | awk '{ print $2 }' | xargs tar -czvf fiat-crypto-build.tar.gz src
if: matrix.os.name != 'Windows'
- name: Upload built files
uses: actions/upload-artifact@v4
with:
name: build-outputs-${{ matrix.name }}
path: fiat-crypto-build.tar.gz
if: matrix.os.name != 'Windows'
- name: install
run: ${{ matrix.sudo-make }} ${{ matrix.coqbin-arg }} EXTERNAL_DEPENDENCIES=1 SKIP_COQSCRIPTS_INCLUDE=1 install install-standalone-ocaml
- name: install-without-bedrock2
run: ${{ matrix.sudo-make }} ${{ matrix.coqbin-arg }} EXTERNAL_DEPENDENCIES=1 SKIP_BEDROCK2=1 install-without-bedrock2 install-standalone-ocaml
- name: install-dev
run: ${{ matrix.sudo-make }} ${{ matrix.coqbin-arg }} EXTERNAL_REWRITER=1 EXTERNAL_COQPRIME=1 install install-standalone-ocaml
- name: display timing info
run: cat time-of-build-pretty.log
if: matrix.os.name != 'Windows'
- name: display timing info
run: type time-of-build-pretty.log
shell: cmd
if: matrix.os.name == 'Windows'
- name: display per-line timing info
run: etc/ci/github-actions-display-per-line-timing.sh
if: matrix.os.name != 'Windows'
- name: display per-line timing info
run: opam exec -- etc/ci/github-actions-display-per-line-timing.sh
if: matrix.os.name == 'Windows'
validate:
runs-on: ubuntu-latest
env: { COQCHKEXTRAFLAGS: "-bytecode-compiler yes" , ALLOW_DIFF: "1" }
name: validate-docker-master
container: 'coqorg/coq:dev'
concurrency:
group: ${{ github.workflow }}-validate-docker-master-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
needs: build
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Download a Build Artifact
uses: actions/download-artifact@v4
with:
name: build-outputs-docker-master
path: .
- name: Unpack build artifact
run: tar --overwrite -xzvf fiat-crypto-build.tar.gz
- name: validate
run: etc/ci/github-actions-docker-make.sh --warnings TIMED=1 validate COQCHKFLAGS="-o ${COQCHKEXTRAFLAGS}"
if: github.event_name != 'pull_request'
build-js-of-ocaml:
needs: build
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
coq-version: [ 'docker-master' ]
ocaml-compiler: [ '4.11.1' ]
concurrency:
group: ${{ github.workflow }}-build-js-of-ocaml-${{ matrix.coq-version }}-${{ matrix.ocaml-compiler }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Set up OCaml
uses: ocaml/setup-ocaml@v2
with:
ocaml-compiler: ${{ matrix.ocaml-compiler }}
- name: opam install deps
run: |
eval $(opam env)
opam update -y
opam install -y js_of_ocaml ocamlfind
- name: echo build params
run: etc/ci/describe-system-config.sh
- name: Download a Build Artifact
uses: actions/download-artifact@v4
with:
name: ExtractionJsOfOCaml-source-${{ matrix.coq-version }}
path: src/ExtractionJsOfOCaml
- name: standalone-js-of-ocaml
run: |
eval $(opam env)
etc/ci/github-actions-make.sh --warnings -f Makefile.standalone -j2 standalone-js-of-ocaml
- name: install-standalone-js-of-ocaml
run: make -f Makefile.standalone install-standalone-js-of-ocaml
- name: upload js_of_ocaml build files
uses: actions/upload-artifact@v4
with:
name: ExtractionJsOfOCaml-${{ matrix.coq-version }}-ocaml-${{ matrix.ocaml-compiler }}
path: src/ExtractionJsOfOCaml
if: always ()
- name: Upload js_of_ocaml outputs
uses: actions/upload-artifact@v4
with:
name: fiat-html-js-of-ocaml
path: fiat-html
build-wasm-of-ocaml:
needs: build
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
coq-version: [ 'docker-master' ]
ocaml-compiler: [ '4.14.1' ]
concurrency:
group: ${{ github.workflow }}-build-wasm-of-ocaml-${{ matrix.coq-version }}-${{ matrix.ocaml-compiler }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Set up OCaml
uses: ocaml/setup-ocaml@v2
with:
ocaml-compiler: ${{ matrix.ocaml-compiler }}
- name: echo build params
run: etc/ci/describe-system-config.sh
- name: Set up binaryen >= 116
uses: acifani/setup-tinygo@v2
with:
tinygo-version: '0.30.0'
binaryen-version: '116'
- name: set up custom dune and wasm_of_ocaml
run: |
eval $(opam env)
opam update -y
opam pin add -y 'https://github.com/ocaml-wasm/dune.git#wasm'
opam pin add -y --no-action --cli=2.1 --with-version 5.3.0 https://github.com/ocaml-wasm/wasm_of_ocaml.git
- name: install wasm_of_ocaml
run: |
eval $(opam env)
opam install -y wasm_of_ocaml-compiler ocamlfind
- name: echo build params
run: etc/ci/describe-system-config.sh
- name: Download a Build Artifact
uses: actions/download-artifact@v4
with:
name: ExtractionJsOfOCaml-source-${{ matrix.coq-version }}
path: src/ExtractionJsOfOCaml
- name: standalone-wasm-of-ocaml
run: |
eval $(opam env)
etc/ci/github-actions-make.sh --warnings -f Makefile.standalone -j2 standalone-wasm-of-ocaml
- name: install-standalone-wasm-of-ocaml
run: make -f Makefile.standalone install-standalone-wasm-of-ocaml
- name: upload wasm_of_ocaml build files
uses: actions/upload-artifact@v4
with:
name: ExtractionJsOfOCaml-${{ matrix.coq-version }}-ocaml-${{ matrix.ocaml-compiler }}+wasm
path: src/ExtractionJsOfOCaml
if: always ()
- name: Upload wasm_of_ocaml outputs
uses: actions/upload-artifact@v4
with:
name: fiat-html-wasm-of-ocaml
path: fiat-html
deploy-js-wasm-of-ocaml:
needs: [build-js-of-ocaml, build-wasm-of-ocaml]
runs-on: ubuntu-latest
concurrency:
group: ${{ github.workflow }}-deploy-js-wasm-of-ocaml-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0 # Fetch all history for all tags and branches, for fiat-html/version.js
tags: true # Fetch all tags as well, `fetch-depth: 0` might be sufficient depending on Git version
- name: Download a Build Artifact
uses: actions/download-artifact@v4
with:
name: fiat-html-js-of-ocaml
path: fiat-html
- run: find fiat-html
- run: ls -la fiat-html
- name: Download a Build Artifact
uses: actions/download-artifact@v4
with:
name: fiat-html-wasm-of-ocaml
path: fiat-html
- run: find fiat-html
- run: ls -la fiat-html
- run: make -f Makefile.js-html fiat-html/version.js
- run: find fiat-html
- run: ls -la fiat-html
- name: backup .gitignore
run: mv .gitignore{,.bak}
- name: Deploy js_of_ocaml and wasm_of_ocaml 🚀 ${{ ( github.ref != 'refs/heads/master' && '(dry run)' ) || '' }}
uses: JamesIves/github-pages-deploy-action@v4.5.0
with:
branch: gh-pages # The branch the action should deploy to.
folder: fiat-html # The folder the action should deploy.
git-config-email: actions@users.noreply.github.com
target-folder: .
single-commit: true # otherwise the repo will get too big
dry-run: ${{ github.ref != 'refs/heads/master' }}
- name: restore .gitignore
run: mv .gitignore{.bak,}
generated-files:
needs: build
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
coq-version: [ 'docker-master' ]
concurrency:
group: ${{ github.workflow }}-generated-files-${{ matrix.coq-version }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Download a Build Artifact
uses: actions/download-artifact@v4
with:
name: ExtractionOCaml-${{ matrix.coq-version }}
path: src/ExtractionOCaml
- name: make binaries executable
run: git check-ignore src/ExtractionOCaml/* | grep -v '\.' | xargs chmod +x
- name: touch binaries to prevent rebuilding
run: git check-ignore src/ExtractionOCaml/* | grep -v '\.' | xargs touch
- name: generated-files
run: etc/ci/github-actions-make.sh --warnings -f Makefile.examples -j2 generated-files
if: github.event_name == 'pull_request'
- run: tar -czvf generated-files.tgz fiat-*/
if: ${{ failure() }}
- name: upload generated files
uses: actions/upload-artifact@v4
with:
name: generated-files-${{ matrix.coq-version }}
path: generated-files.tgz
if: ${{ failure() }}
standalone-haskell:
needs: build
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
coq-version: [ 'docker-master' ]
concurrency:
group: ${{ github.workflow }}-standalone-haskell-${{ matrix.coq-version }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Download a Build Artifact
uses: actions/download-artifact@v4
with:
name: ExtractionHaskell-source-${{ matrix.coq-version }}
path: src/ExtractionHaskell
- name: standalone-haskell
run: etc/ci/github-actions-make.sh -f Makefile.standalone -j1 standalone-haskell GHCFLAGS='+RTS -M7G -RTS'
- name: upload Haskell files
uses: actions/upload-artifact@v4
with:
name: ExtractionHaskell-${{ matrix.coq-version }}
path: src/ExtractionHaskell
if: always ()
test-amd64:
runs-on: ubuntu-latest
concurrency:
group: ${{ github.workflow }}-test-amd64-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
needs: build
steps:
- name: checkout repo
uses: actions/checkout@v4
with:
submodules: recursive
- name: Download a Build Artifact
uses: actions/download-artifact@v4
with:
name: ExtractionOCaml-docker-master
path: src/ExtractionOCaml
- name: make binaries executable
run: git check-ignore src/ExtractionOCaml/* | grep -v '\.' | xargs chmod +x
- name: only-test-amd64-files
run: etc/ci/github-actions-make.sh -f Makefile.examples -j2 only-test-amd64-files SLOWEST_FIRST=1
env:
ALLOW_DIFF: 1
test-standalone:
strategy:
fail-fast: false
matrix:
source-name: [ 'docker-master' , 'alpine-edge' , 'archlinux' , 'debian-sid' , 'windows' , 'macos' ]
os: [ {name: 'Ubuntu', runs-on: 'ubuntu-latest', container: {name: '', image: ''} }
, {name: 'Windows', runs-on: 'windows-latest', container: {name: '', image: ''} }
, {name: 'macOS', runs-on: 'macos-latest', container: {name: '', image: ''} }
, {container: { name: 'coqorg/coq', image: 'coqorg/coq:dev' }, name: 'Ubuntu', runs-on: 'ubuntu-latest'}
, {container: { name: 'alpine', image: 'alpine:edge' }, name: 'Ubuntu', runs-on: 'ubuntu-latest'}
, {container: { name: 'archlinux', image: 'archlinux' }, name: 'Ubuntu', runs-on: 'ubuntu-latest'}
, {container: { name: 'debian', image: 'debian:sid' }, name: 'Ubuntu', runs-on: 'ubuntu-latest'}
runs-on: ${{ matrix.os.runs-on }}
name: test-standalone-${{ matrix.source-name }}-on-${{ matrix.os.name }}-${{ matrix.os.container.name }}
container: ${{ matrix.os.container.image }}
needs: build
steps:
- name: Install System Dependencies (coqorg/coq)
run: |
sudo apt-get -o Acquire::Retries=30 update -y
sudo apt-get -o Acquire::Retries=30 install -y --allow-unauthenticated file
if: matrix.os.container.name == 'coqorg/coq'
- uses: actions/checkout@v4
- name: Download standalone
uses: actions/download-artifact@v4
with:
name: standalone-${{ matrix.source-name }}
path: dist/
- name: List files
run: find dist
- run: chmod +x dist/fiat_crypto
- name: Test files
run: |
echo "::group::file fiat_crypto"
file dist/fiat_crypto
echo "::endgroup::"
echo "::group::ldd fiat_crypto"
ldd dist/fiat_crypto
echo "::endgroup::"
etc/ci/test-run-fiat-crypto.sh dist/fiat_crypto
publish-standalone:
runs-on: ubuntu-latest
needs: build
permissions:
contents: write # IMPORTANT: mandatory for making GitHub Releases
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch all history for all tags and branches
tags: true # Fetch all tags as well, `fetch-depth: 0` might be sufficient depending on Git version
- name: Download standalone alpine-edge
uses: actions/download-artifact@v4
with:
name: standalone-alpine-edge
path: dist-linux/
- name: Download standalone Windows
uses: actions/download-artifact@v4
with:
name: standalone-windows
path: dist-windows/
- name: Download standalone MacOS
uses: actions/download-artifact@v4
with:
name: standalone-macos
path: dist-macos/
- name: List files
run: find dist*
- run: mkdir dist
- name: Rename Linux files
run: |
echo "::group::find arch"
arch="$(etc/ci/find-arch.sh dist-linux/fiat_crypto "unknown")"
tag="$(git describe --tags HEAD)"
fname="Fiat-Cryptography_${tag}_Linux_docker_dev_${arch}"
echo "$fname"
mv dist-linux/fiat_crypto "dist/$fname"
find dist
- name: Rename MacOS files
run: |
arch="$(etc/ci/find-arch.sh dist-macos/fiat_crypto)"
tag="$(git describe --tags HEAD)"
fname="Fiat-Cryptography_${tag}_macOS_${arch}"
echo "$fname"
mv dist-macos/fiat_crypto "dist/$fname"
find dist
- name: Rename Windows files
run: |
arch="$(etc/ci/find-arch.sh dist-windows/fiat_crypto.exe "x86_64")"
tag="$(git describe --tags HEAD)"
fname="Fiat-Cryptography_${tag}_Windows_${arch}.exe"
echo "$fname"
mv dist-windows/fiat_crypto.exe "dist/$fname"
find dist
- name: Upload artifacts to GitHub Release
env:
GITHUB_TOKEN: ${{ github.token }}
# Upload to GitHub Release using the `gh` CLI.
# `dist/` contains the built packages
run: >-
gh release upload
'${{ github.ref_name }}' dist/**
--repo '${{ github.repository }}'
if: ${{ startsWith(github.ref, 'refs/tags/') && github.event_name == 'release' }}
check-all:
runs-on: ubuntu-latest
needs: [build, validate, build-js-of-ocaml, build-wasm-of-ocaml, deploy-js-wasm-of-ocaml, generated-files, standalone-haskell, test-amd64, test-standalone, publish-standalone]
if: always()
steps:
- run: echo 'build passed'
if: ${{ needs.build.result == 'success' }}
- run: echo 'validate passed'
if: ${{ needs.validate.result == 'success' }}
- run: echo 'build-js-of-ocaml passed'
if: ${{ needs.build-js-of-ocaml.result == 'success' }}
- run: echo 'build-wasm-of-ocaml passed'
if: ${{ needs.build-wasm-of-ocaml.result == 'success' }}
- run: echo 'deploy-js-wasm-of-ocaml passed'
if: ${{ needs.deploy-js-wasm-of-ocaml.result == 'success' }}
- run: echo 'generated-files passed'
if: ${{ needs.generated-files.result == 'success' }}
- run: echo 'standalone-haskell passed'
if: ${{ needs.standalone-haskell.result == 'success' }}
- run: echo 'test-amd64 passed'
if: ${{ needs.test-amd64.result == 'success' }}
- run: echo 'test-standalone passed'
if: ${{ needs.test-standalone.result == 'success' }}
- run: echo 'publish-standalone passed'
if: ${{ needs.publish-standalone.result == 'success' }}
- run: echo 'build failed' && false
if: ${{ needs.build.result != 'success' }}
- run: echo 'validate failed' && false
if: ${{ needs.validate.result != 'success' }}
- run: echo 'build-js-of-ocaml failed' && false
if: ${{ needs.build-js-of-ocaml.result != 'success' }}
- run: echo 'build-wasm-of-ocaml failed' && false
if: ${{ needs.build-wasm-of-ocaml.result != 'success' }}
- run: echo 'deploy-js-wasm-of-ocaml failed' && false
if: ${{ needs.deploy-js-wasm-of-ocaml.result != 'success' }}
- run: echo 'generated-files failed' && false
if: ${{ needs.generated-files.result != 'success' }}
- run: echo 'standalone-haskell failed' && false
if: ${{ needs.standalone-haskell.result != 'success' }}
- run: echo 'test-amd64 failed' && false
if: ${{ needs.test-amd64.result != 'success' }}
- run: echo 'test-standalone failed' && false
if: ${{ needs.test-standalone.result != 'success' }}
- run: echo 'publish-standalone failed' && false
if: ${{ needs.publish-standalone.result != 'success' }}