-
Notifications
You must be signed in to change notification settings - Fork 155
207 lines (202 loc) · 7.62 KB
/
release.yml
File metadata and controls
207 lines (202 loc) · 7.62 KB
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
name: 'Release'
on:
push:
branches:
- 'release'
concurrency:
group: ${{ github.workflow }}
cancel-in-progress: true
jobs:
draft-release:
name: 'Draft Release'
runs-on: ubuntu-latest
outputs:
version: ${{ steps.make-release.outputs.version }}
steps:
- name: 'Check out code'
uses: actions/checkout@v4
- name: 'Make release'
id: 'make-release'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
set -x
VERSION=v$(cat package/version)
gh release create ${VERSION} \
--repo runtimeverification/evm-semantics \
--draft \
--title ${VERSION} \
--target ${{ github.sha }}
echo "version=${VERSION}" >> "$GITHUB_OUTPUT"
nix-cache:
name: 'Populate Nix Cache'
strategy:
matrix:
include:
- runner: normal
- runner: ARM64
runs-on: ${{ matrix.runner }}
needs: draft-release
steps:
- name: 'Check out code'
uses: actions/checkout@v4
with:
ref: ${{ github.event.push.head.sha }}
fetch-depth: 0
- name: 'Build KEVM'
run: |
GC_DONT_GC=1 nix build --extra-experimental-features 'nix-command flakes' --print-build-logs
- name: 'Push KEVM dependencies to nix cache'
uses: workflow/nix-shell-action@v3.0.3
env:
GC_DONT_GC: 1
CACHIX_AUTH_TOKEN: '${{ secrets.CACHIX_PUBLIC_TOKEN }}'
with:
packages: jq
script: |
kevm=$(nix build --extra-experimental-features 'nix-command flakes' .#kevm --json | jq -r '.[].outputs | to_entries[].value')
drv=$(nix-store --query --deriver ${kevm})
nix-store --query --requisites --include-outputs ${drv} | cachix push k-framework || true
- name: 'On failure, delete drafted release'
if: failure()
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
set -x
VERSION=v$(cat package/version)
gh release delete ${VERSION} \
--repo runtimeverification/evm-semantics \
--yes \
--cleanup-tag
- name: 'Post failure to channel'
if: failure()
uses: slackapi/slack-github-action@v1.24.0
with:
channel-id: "#kevm-notifications"
slack-message: "Failed to create KEVM release: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
nix-binary-cache:
name: 'Populate Nix Binary Cache'
strategy:
matrix:
include:
- runner: normal
- runner: ARM64
runs-on: ${{ matrix.runner }}
needs: draft-release
steps:
- name: 'Check out code'
uses: actions/checkout@v4
with:
ref: ${{ github.event.push.head.sha }}
fetch-depth: 0
- name: 'Publish KEVM to k-framework-binary cache'
uses: workflow/nix-shell-action@v3.0.3
env:
GC_DONT_GC: '1'
CACHIX_AUTH_TOKEN: '${{ secrets.CACHIX_PRIVATE_KFB_TOKEN }}'
OWNER_REPO: '${{ github.repository }}'
REV: '${{ github.sha }}'
with:
packages: jq
script: |
export PATH="$(nix build github:runtimeverification/kup --no-link --json | jq -r '.[].outputs | to_entries[].value')/bin:$PATH"
kup publish k-framework-binary .#kevm --keep-days 180 || true
# Cachix has not been responding to 'cachix pin' requests made under the hood by kup. Verify the push and pin manually.
.github/scripts/check-cachix-pin.sh
- name: 'On failure, delete drafted release'
if: failure()
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
set -x
VERSION=v$(cat package/version)
gh release delete ${VERSION} \
--repo runtimeverification/evm-semantics \
--yes \
--cleanup-tag
- name: 'Post failure to channel'
if: failure()
uses: slackapi/slack-github-action@v1.24.0
with:
channel-id: "#kevm-notifications"
slack-message: "Failed to create KEVM release: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
make-release:
name: 'Cut Release'
runs-on: ubuntu-latest
needs: [draft-release, nix-cache, nix-binary-cache]
steps:
- name: 'Check out code'
uses: actions/checkout@v4
with:
ref: ${{ github.event.push.head.sha }}
fetch-depth: 0
- name: 'Make release'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
set -x
VERSION=v$(cat package/version)
gh release edit ${VERSION} \
--repo runtimeverification/evm-semantics \
--draft=false
- name: 'Update dependents'
run: |
set -x
VERSION=$(cat package/version)
curl --fail \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.JENKINS_GITHUB_PAT }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/runtimeverification/devops/dispatches \
-d '{"event_type":"on-demand-test","client_payload":{"repo":"runtimeverification/evm-semantics","version":"'${VERSION}'"}}'
gh-pages:
name: 'Publish GH Pages'
runs-on: ubuntu-latest
needs: [make-release]
steps:
- name: 'Check out gh-pages'
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: true
ref: ${{ github.event.push.head.sha }}
- run: |
git config --global user.email 'devops@runtimeverification.com'
git config --global user.name 'rv-jenkins'
- name: 'Publish gh-pages'
run: |
git checkout -B gh-pages
cd web
npm install
npm run build
npm run build-sitemap
cd -
mv web/public_content ./
rm -rf $(find . -maxdepth 1 -not -name public_content -a -not -name .git -a -not -name .gitmodules -a -not -path . -a -not -path .. -a -not -name CNAME)
mv public_content/* ./
rm -rf public_content
git add ./
git commit -m 'gh-pages: Updated the website'
git merge --strategy ours origin/gh-pages --allow-unrelated-histories
git push origin gh-pages
- name: 'Post failure to channel'
if: failure()
uses: slackapi/slack-github-action@v1.24.0
with:
channel-id: "#kevm-notifications"
slack-message: "Failed to create KEVM release: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
- name: 'Post success to channel'
if: success()
uses: slackapi/slack-github-action@v1.24.0
with:
channel-id: "#kevm-notifications"
slack-message: "Created KEVM release: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}