-
Notifications
You must be signed in to change notification settings - Fork 323
292 lines (288 loc) · 8.99 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
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
name: release
on:
push:
tags: ["v*"]
branches: ["main", "mise", "release/*"]
workflow_dispatch:
concurrency:
group: release-${{ github.ref_name }}
env:
CARGO_TERM_COLOR: always
CARGO_INCREMENTAL: 0
DRY_RUN: ${{ startsWith(github.event.ref, 'refs/tags/v') && '0' || '1' }}
jobs:
build-tarball:
name: build-tarball-${{matrix.name}}
runs-on: ${{matrix.runs-on}}
timeout-minutes: 45
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu
name: linux-x64
target: x86_64-unknown-linux-gnu
runs-on: ubuntu-latest
- os: ubuntu
name: linux-x64-musl
target: x86_64-unknown-linux-musl
runs-on: ubuntu-latest
- os: ubuntu
name: linux-arm64
target: aarch64-unknown-linux-gnu
runs-on: ubuntu-latest
- os: ubuntu
name: linux-arm64-musl
target: aarch64-unknown-linux-musl
runs-on: ubuntu-latest
- os: ubuntu
name: linux-armv7
target: armv7-unknown-linux-gnueabi
runs-on: ubuntu-latest
- os: ubuntu
name: linux-armv7-musl
target: armv7-unknown-linux-musleabi
runs-on: ubuntu-latest
- os: ubuntu
name: linux-armv6
target: arm-unknown-linux-gnueabi
runs-on: ubuntu-latest
- os: ubuntu
name: linux-armv6-musl
target: arm-unknown-linux-musleabi
runs-on: ubuntu-latest
- os: macos
name: macos-x64
target: x86_64-apple-darwin
runs-on: macos-14
- os: macos
name: macos-arm64
target: aarch64-apple-darwin
runs-on: macos-14
# - os: macos
# name: macos
# target: universal2-apple-darwin
# runs-on: macos-12
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: ~/.cargo/bin/zipsign
key: ${{ runner.os }}-cargo-zipsign
- run: rustup target add ${{matrix.target}}
- run: rustup toolchain install stable --profile minimal
- uses: Swatinem/rust-cache@v2
with:
shared-key: build-tarball-${{matrix.name}}
- if: matrix.os == 'ubuntu'
uses: taiki-e/install-action@cross
- run: scripts/setup-zipsign.sh
env:
ZIPSIGN: ${{ secrets.ZIPSIGN }}
- run: scripts/build-tarball.sh mise --release --features openssl/vendored --target ${{matrix.target}}
- uses: actions/upload-artifact@v4
with:
name: tarball-${{matrix.target}}
path: |
dist/mise-*.tar.xz
dist/mise-*.tar.gz
if-no-files-found: error
e2e-linux:
name: e2e-linux-${{matrix.tranche}}
runs-on: ubuntu-latest
#container: ghcr.io/jdx/mise:github-actions
needs: [build-tarball]
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
tranche: [0, 1, 2, 3]
steps:
- uses: actions/checkout@v4
- name: Install zsh/fish/direnv
run: sudo apt-get update; sudo apt-get install zsh fish direnv
- uses: actions/download-artifact@v4
with:
name: tarball-x86_64-unknown-linux-gnu
path: dist
- uses: taiki-e/install-action@v2
with:
tool: usage-cli
- run: tar -C "$HOME" -xvJf "dist/mise-$(./scripts/get-version.sh)-linux-x64.tar.xz"
- run: echo "$HOME/mise/bin" >> "$GITHUB_PATH"
- run: mise -v
- name: Run e2e tests
uses: nick-fields/retry@v3
env:
GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
RUST_BACKTRACE: "1"
TEST_TRANCHE: ${{matrix.tranche}}
TEST_TRANCHE_COUNT: 4
TEST_ALL: 1
with:
timeout_minutes: 20
max_attempts: 3
command: ./e2e/run_all_tests
rpm:
runs-on: ubuntu-22.04
needs: [build-tarball]
timeout-minutes: 10
container: ghcr.io/jdx/mise:rpm
steps:
- uses: actions/checkout@v4
- uses: crazy-max/ghaction-import-gpg@v6
with:
gpg_private_key: ${{ secrets.MISE_GPG_KEY }}
- uses: actions/download-artifact@v4
with:
name: tarball-x86_64-unknown-linux-gnu
path: dist
- uses: actions/download-artifact@v4
with:
name: tarball-aarch64-unknown-linux-gnu
path: dist
- run: scripts/build-rpm.sh
- uses: actions/upload-artifact@v4
with:
name: rpm
path: dist/rpmrepo
if-no-files-found: error
deb:
runs-on: ubuntu-22.04
container: ghcr.io/jdx/mise:deb
timeout-minutes: 10
needs: [build-tarball]
steps:
- uses: actions/checkout@v4
- uses: crazy-max/ghaction-import-gpg@v6
with:
gpg_private_key: ${{ secrets.MISE_GPG_KEY }}
- uses: actions/download-artifact@v4
with:
name: tarball-x86_64-unknown-linux-gnu
path: dist
- uses: actions/download-artifact@v4
with:
name: tarball-aarch64-unknown-linux-gnu
path: dist
- run: scripts/build-deb.sh
- uses: actions/upload-artifact@v4
with:
name: deb
path: dist/deb
if-no-files-found: error
release:
runs-on: ubuntu-latest
#container: ghcr.io/jdx/mise:github-actions
timeout-minutes: 10
permissions:
contents: write
needs:
- e2e-linux
- build-tarball
- rpm
- deb
steps:
- uses: actions/checkout@v4
with:
path: mise
- uses: actions/checkout@v4
with:
repository: jdx/mise-docs
path: mise-docs
token: ${{ secrets.RTX_GITHUB_BOT_TOKEN }}
- name: Install fd-find
run: |
sudo apt-get update
sudo apt-get install fd-find
mkdir -p "$HOME/.local/bin"
ln -s "$(which fdfind)" "$HOME/.local/bin/fd"
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
- uses: actions/setup-node@v4
with:
node-version: "20.x"
registry-url: "https://registry.npmjs.org"
- uses: shimataro/ssh-key-action@v2
with:
key: ${{ secrets.RTX_SSH_KEY }}
known_hosts: ${{ secrets.RTX_KNOWN_HOSTS_AUR }}
- uses: crazy-max/ghaction-import-gpg@v6
with:
gpg_private_key: ${{ secrets.MISE_GPG_KEY }}
git_user_signingkey: true
git_commit_gpgsign: true
workdir: mise-docs
- uses: actions/download-artifact@v4
with: { path: artifacts }
- run: mise/scripts/release.sh
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
CLOUDFLARE_ACCESS_KEY_ID: ${{ secrets.CLOUDFLARE_ACCESS_KEY_ID }}
CLOUDFLARE_SECRET_ACCESS_KEY: ${{ secrets.CLOUDFLARE_SECRET_ACCESS_KEY }}
- name: mise-docs push
if: startsWith(github.event.ref, 'refs/tags/v')
run: git push
working-directory: mise-docs
- name: GitHub Release Assets
uses: softprops/action-gh-release@v2
if: startsWith(github.event.ref, 'refs/tags/v')
with:
fail_on_unmatched_files: true
draft: false
files: releases/${{github.ref_name}}/*
generate_release_notes: true
token: ${{ secrets.RTX_GITHUB_BOT_TOKEN }}
bump-homebrew-formula:
runs-on: macos-14
timeout-minutes: 10
needs: [release]
continue-on-error: true
if: startsWith(github.event.ref, 'refs/tags/v')
steps:
- name: Bump Homebrew formula
uses: dawidd6/action-homebrew-bump-formula@v3
with:
token: ${{ secrets.RTX_GITHUB_BOT_TOKEN }}
formula: mise
bump-aur:
runs-on: ubuntu-22.04
timeout-minutes: 30
needs: [e2e-linux]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- uses: shimataro/ssh-key-action@v2
with:
key: ${{ secrets.RTX_SSH_KEY }}
known_hosts: ${{ secrets.RTX_KNOWN_HOSTS_AUR }}
- name: Bump aur
run: ./scripts/release-aur.sh
bump-aur-bin:
runs-on: ubuntu-22.04
timeout-minutes: 30
needs: [release]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- uses: shimataro/ssh-key-action@v2
with:
key: ${{ secrets.RTX_SSH_KEY }}
known_hosts: ${{ secrets.RTX_KNOWN_HOSTS_AUR }}
- name: Bump aur-bin
run: ./scripts/release-aur-bin.sh
bump-alpine:
runs-on: ubuntu-22.04
container: ghcr.io/jdx/rtx:alpine
timeout-minutes: 30
needs: [e2e-linux]
if: startsWith(github.event.ref, 'refs/tags/v')
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Bump APKBUILD
run: sudo -Eu packager ./scripts/release-alpine.sh
env:
ALPINE_PUB_KEY: ${{ secrets.ALPINE_PUB_KEY }}
ALPINE_PRIV_KEY: ${{ secrets.ALPINE_PRIV_KEY }}
GITLAB_TOKEN: ${{ secrets.GITLAB_TOKEN }}