-
Notifications
You must be signed in to change notification settings - Fork 219
186 lines (158 loc) · 5.66 KB
/
release.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
name: Release
on:
push:
branches:
- master
jobs:
release-please:
name: Create Release
outputs:
release-pr: ${{ steps.release.outputs.pr }}
tag-name: ${{ steps.release.outputs.tag_name }}
runs-on: ubuntu-22.04
steps:
- name: Run release-please
id: release
uses: googleapis/release-please-action@v4
with:
token: ${{ secrets.NOIR_RELEASES_TOKEN }}
update-acvm-workspace-package-versions:
name: Update acvm workspace package versions
needs: [release-please]
if: ${{ needs.release-please.outputs.release-pr }}
runs-on: ubuntu-22.04
steps:
- name: Checkout release branch
uses: actions/checkout@v4
with:
ref: ${{ fromJSON(needs.release-please.outputs.release-pr).headBranchName }}
token: ${{ secrets.NOIR_RELEASES_TOKEN }}
- name: Setup toolchain
uses: dtolnay/rust-toolchain@1.65.0
- name: Update ACVM workspace root versions
run: |
./scripts/update-acvm-workspace-versions.sh
- name: Update lockfile
run: |
cargo update --workspace
- uses: actions/setup-node@v3
with:
node-version: 18.19.0
cache: 'yarn'
cache-dependency-path: 'yarn.lock'
- name: Update yarn.lock
run: yarn
- name: Configure git
run: |
git config user.name noirwhal
git config user.email tomfrench@aztecprotocol.com
- name: Commit updates
run: |
git add .
git commit -m 'chore: Update root workspace acvm versions and lockfile'
git push
update-docs:
name: Update docs
needs: [release-please, update-acvm-workspace-package-versions]
if: ${{ needs.release-please.outputs.release-pr }}
runs-on: ubuntu-22.04
steps:
- name: Checkout release branch
uses: actions/checkout@v4
with:
ref: ${{ fromJSON(needs.release-please.outputs.release-pr).headBranchName }}
token: ${{ secrets.NOIR_RELEASES_TOKEN }}
- name: Install Yarn dependencies
uses: ./.github/actions/setup
- name: Install wasm-bindgen-cli
uses: taiki-e/install-action@v2
with:
tool: wasm-bindgen-cli@0.2.86
- name: Install wasm-opt
run: |
npm i wasm-opt -g
- name: Query new noir version
id: noir-version
run: |
NOIR_VERSION=$(grep '^version =' ./Cargo.toml | sed -E 's/version = "([^"]+)"/v\1/')
echo "semver=$NOIR_VERSION" >> $GITHUB_OUTPUT
- name: Cut a new version
working-directory: ./docs
run: yarn version ${{ steps.noir-version.outputs.semver }}
- name: Configure git
run: |
git config --local user.name noirwhal
git config --local user.email tomfrench@aztecprotocol.com
- name: Commit new documentation version
run: |
git add .
git commit -m "chore(docs): cut new docs version for tag ${{ steps.noir-version.outputs.semver }}"
git push
release-end:
name: Release End
runs-on: ubuntu-22.04
# We want this job to always run (even if the dependant jobs fail) as we need apply changes to the sticky comment.
if: ${{ always() }}
needs:
- release-please
- update-acvm-workspace-package-versions
- update-docs
env:
# We treat any skipped or failing jobs as a failure for the workflow as a whole.
FAIL: ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') || contains(needs.*.result, 'skipped') }}
steps:
- name: Add warning to sticky comment
uses: marocchino/sticky-pull-request-comment@v2
with:
# We need to specify the PR on which to make the comment as workflow is triggered by push.
number: ${{ fromJSON(needs.release-please.outputs.release-pr).number }}
# delete the comment in case failures have been fixed
delete: ${{ env.FAIL == false }}
message: "The release workflow has not completed successfully. Releasing now will result in a broken release"
- name: Report overall success
run: |
if [[ $FAIL == true ]]; then
exit 1
else
exit 0
fi
build-binaries:
name: Build binaries
needs: [release-please]
if: ${{ needs.release-please.outputs.tag-name }}
runs-on: ubuntu-22.04
steps:
- name: Dispatch to publish workflow
uses: benc-uk/workflow-dispatch@v1
with:
workflow: publish-nargo.yml
repo: noir-lang/noir
ref: master
token: ${{ secrets.GITHUB_TOKEN }}
inputs: '{ "tag": "${{ needs.release-please.outputs.tag-name }}", "publish": true }'
publish-es-packages:
name: Publish ES packages
needs: [release-please]
if: ${{ needs.release-please.outputs.tag-name }}
runs-on: ubuntu-22.04
steps:
- name: Dispatch to publish-es-packages
uses: benc-uk/workflow-dispatch@v1
with:
workflow: publish-es-packages.yml
ref: master
token: ${{ secrets.NOIR_REPO_TOKEN }}
inputs: '{ "noir-ref": "${{ needs.release-please.outputs.tag-name }}", "npm-tag": "latest" }'
publish-acvm:
name: Publish acvm
needs: [release-please]
if: ${{ needs.release-please.outputs.tag-name }}
runs-on: ubuntu-22.04
steps:
- name: Dispatch to publish-acvm
uses: benc-uk/workflow-dispatch@v1
with:
workflow: publish-acvm.yml
ref: master
token: ${{ secrets.NOIR_REPO_TOKEN }}
inputs: '{ "noir-ref": "${{ needs.release-please.outputs.tag-name }}" }'