forked from kind2-mc/kind2
-
Notifications
You must be signed in to change notification settings - Fork 1
141 lines (116 loc) · 3.48 KB
/
kind2-nightly.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
name: Nightly Build
# Run the nightly build at 8 AM UTC / 2 AM Central
on:
workflow_dispatch:
schedule:
- cron: "0 8 * * *"
jobs:
kind2-linux-bin:
if: github.repository == 'kind2-mc/kind2'
runs-on: ubuntu-latest
services:
registry:
image: registry:2
ports:
- 5000:5000
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
with:
driver-opts: network=host
- name: Build and push to local registry
uses: docker/build-push-action@v3
with:
file: docker/Dockerfile
context: ./
target: builder
push: true
tags: localhost:5000/name/kind2:latest
- name: Extract kind 2 binary
id: extract
uses: shrink/actions-docker-extract@v2
with:
image: localhost:5000/name/kind2:latest
path: /home/opam/kind2-build/bin/kind2
- name: Upload kind2 binary
uses: actions/upload-artifact@v3
with:
path: ${{ steps.extract.outputs.destination }}
name: linux
kind2-macos-bin:
if: github.repository == 'kind2-mc/kind2'
strategy:
matrix: # Single configuration
ocaml-version: [ 4.14.1 ]
# Only matrix variables can be used at runs-on
os: [ macos-12 ]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up OCaml ${{ matrix.ocaml-version }}+flambda
uses: ocaml/setup-ocaml@v2
with:
ocaml-compiler: ocaml-variants.${{ matrix.ocaml-version }}+options,ocaml-option-flambda
- name: Install Kind2 OCaml dependencies
run: opam install -y . --deps-only
- name: Build Kind 2
run: opam exec make static
- name: Strip binary
run: strip bin/kind2
- name: Upload Kind 2 binary
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.os }}
path: bin/kind2
get-ready-release:
if: github.repository == 'kind2-mc/kind2' && !failure()
runs-on: ubuntu-latest
needs: [kind2-linux-bin, kind2-macos-bin]
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Delete old assets
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
ids=$(gh release view nightly --json assets --jq '.assets | map(.name) | .[]')
for id in $ids;
do
gh release delete-asset nightly $id -y
done
- name: Update nightly tag
run: |
git config user.name github-actions
git config user.email [email protected]
git tag -f nightly
git push --tags -f
upload-artifact:
if: github.repository == 'kind2-mc/kind2' && !failure()
runs-on: ubuntu-latest
needs: [get-ready-release]
strategy:
matrix:
version: [linux, macos-12]
steps:
- name: Download binary
uses: actions/download-artifact@v3
with:
name: ${{ matrix.version }}
- name: Create tar.gz file
id: create_tarball
run: |
chmod u+x kind2
date=$(date "+%Y-%m-%d")
tarball=kind2-$date-${{ matrix.version }}-x86_64.tar.gz
tar -czf $tarball kind2
echo "filename=$tarball" >> $GITHUB_OUTPUT
- name: Upload release asset
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release upload nightly \
${{ steps.create_tarball.outputs.filename }} \
--repo $GITHUB_REPOSITORY