Skip to content

Commit 244ec18

Browse files
committed
Merge remote-tracking branch 'origin/main' into quenting/optional-email
2 parents 7e6ab8f + 154e42a commit 244ec18

30 files changed

+2008
-1734
lines changed

.github/release.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
changelog:
2+
categories:
3+
- title: Bug Fixes
4+
labels:
5+
- T-Defect
6+
7+
- title: New Features
8+
labels:
9+
- T-Enhancement
10+
exclude:
11+
labels:
12+
- A-Admin-API
13+
- A-Documentation
14+
15+
- title: Changes to the admin API
16+
labels:
17+
- A-Admin-API
18+
19+
- title: Documentation
20+
labels:
21+
- A-Documentation
22+
23+
- title: Translations
24+
labels:
25+
- A-I18n
26+
27+
- title: Internal Changes
28+
labels:
29+
- T-Task
30+
31+
- title: Other Changes
32+
labels:
33+
- "*"
34+
exclude:
35+
labels:
36+
- A-Dependencies
37+
38+
- title: Dependency Updates
39+
labels:
40+
- A-Dependencies

.github/workflows/build.yaml

Lines changed: 99 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ jobs:
115115
done
116116
117117
- name: Upload the artifacts
118-
uses: actions/upload-artifact@v4.5.0
118+
uses: actions/upload-artifact@v4.6.0
119119
with:
120120
name: binaries
121121
path: |
@@ -135,9 +135,6 @@ jobs:
135135
id-token: write
136136

137137
steps:
138-
- name: Checkout the code
139-
uses: actions/[email protected]
140-
141138
- name: Docker meta
142139
id: meta
143140
uses: docker/[email protected]
@@ -205,32 +202,28 @@ jobs:
205202
# For pull-requests, only read from the cache, do not try to push to the
206203
# cache or the image itself
207204
- name: Build
208-
uses: docker/bake-action@v5.11.0
205+
uses: docker/bake-action@v6.2.0
209206
if: github.event_name == 'pull_request'
210207
with:
211208
files: |
212-
docker-bake.hcl
213-
${{ steps.meta.outputs.bake-file }}
214-
${{ steps.meta-debug.outputs.bake-file }}
215-
${{ steps.meta-syn2mas.outputs.bake-file }}
209+
./docker-bake.hcl
210+
cwd://${{ steps.meta.outputs.bake-file }}
211+
cwd://${{ steps.meta-debug.outputs.bake-file }}
212+
cwd://${{ steps.meta-syn2mas.outputs.bake-file }}
216213
set: |
217-
base.context=https://github.com/${{ github.repository }}.git#${{ github.ref }}
218-
syn2mas.context=https://github.com/${{ github.repository }}.git#${{ github.ref }}:tools/syn2mas/
219214
base.cache-from=type=registry,ref=${{ env.BUILDCACHE }}:buildcache
220215
221216
- name: Build and push
222217
id: bake
223-
uses: docker/bake-action@v5.11.0
218+
uses: docker/bake-action@v6.2.0
224219
if: github.event_name != 'pull_request'
225220
with:
226221
files: |
227-
docker-bake.hcl
228-
${{ steps.meta.outputs.bake-file }}
229-
${{ steps.meta-debug.outputs.bake-file }}
230-
${{ steps.meta-syn2mas.outputs.bake-file }}
222+
./docker-bake.hcl
223+
cwd://${{ steps.meta.outputs.bake-file }}
224+
cwd://${{ steps.meta-debug.outputs.bake-file }}
225+
cwd://${{ steps.meta-syn2mas.outputs.bake-file }}
231226
set: |
232-
base.context=https://github.com/${{ github.repository }}.git#${{ github.ref }}
233-
syn2mas.context=https://github.com/${{ github.repository }}.git#${{ github.ref }}:tools/syn2mas/
234227
base.output=type=image,push=true
235228
base.cache-from=type=registry,ref=${{ env.BUILDCACHE }}:buildcache
236229
base.cache-to=type=registry,ref=${{ env.BUILDCACHE }}:buildcache,mode=max
@@ -251,11 +244,16 @@ jobs:
251244
github.event_name != 'pull_request'
252245
&& (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main')
253246
247+
env:
248+
REGULAR_DIGEST: ${{ steps.output.outputs.metadata && fromJSON(steps.output.outputs.metadata).regular.digest }}
249+
DEBUG_DIGEST: ${{ steps.output.outputs.metadata && fromJSON(steps.output.outputs.metadata).debug.digest }}
250+
SYN2MAS_DIGEST: ${{ steps.output.outputs.metadata && fromJSON(steps.output.outputs.metadata).syn2mas.digest }}
251+
254252
run: |-
255253
cosign sign --yes \
256-
"${{ env.IMAGE }}@${{ fromJSON(steps.output.outputs.metadata).regular.digest }}" \
257-
"${{ env.IMAGE }}@${{ fromJSON(steps.output.outputs.metadata).debug.digest }}" \
258-
"${{ env.IMAGE_SYN2MAS }}@${{ fromJSON(steps.output.outputs.metadata).syn2mas.digest }}"
254+
"$IMAGE@$REGULAR_DIGEST" \
255+
"$IMAGE@$DEBUG_DIGEST" \
256+
"$IMAGE_SYN2MAS@$SYN2MAS_DIGEST"
259257
260258
syn2mas:
261259
name: Release syn2mas on NPM
@@ -303,6 +301,7 @@ jobs:
303301
- name: Prepare a release
304302
uses: softprops/action-gh-release@v2
305303
with:
304+
generate_release_notes: true
306305
body: |
307306
### Docker image
308307
@@ -346,3 +345,82 @@ jobs:
346345
artifacts/mas-cli-aarch64-linux.tar.gz
347346
artifacts/mas-cli-x86_64-linux.tar.gz
348347
draft: true
348+
349+
unstable:
350+
name: Update the unstable release
351+
runs-on: ubuntu-24.04
352+
needs:
353+
- build-binaries
354+
- build-image
355+
if: github.ref == 'refs/heads/main'
356+
357+
permissions:
358+
contents: write
359+
360+
steps:
361+
- name: Download the artifacts from the previous job
362+
uses: actions/download-artifact@v4
363+
with:
364+
name: binaries
365+
path: artifacts
366+
367+
- name: Update unstable git tag
368+
uses: actions/[email protected]
369+
with:
370+
script: |
371+
const [owner, repo] = process.env.GITHUB_REPOSITORY.split("/");
372+
const sha = process.env.GITHUB_SHA;
373+
374+
const tag = await github.rest.git.updateRef({
375+
owner,
376+
repo,
377+
force: true,
378+
ref: 'tags/unstable',
379+
sha,
380+
});
381+
console.log("Updated tag ref:", tag.data.url);
382+
383+
- name: Update unstable release
384+
uses: softprops/action-gh-release@v2
385+
with:
386+
name: 'Unstable build'
387+
tag_name: unstable
388+
body: |
389+
This is an automatically updated unstable release containing the latest builds from the main branch.
390+
391+
**⚠️ Warning: These are development builds and may be unstable.**
392+
393+
Last updated: ${{ github.event.head_commit.timestamp }}
394+
Commit: ${{ github.sha }}
395+
396+
### Docker image
397+
398+
Regular image:
399+
400+
- Digest:
401+
```
402+
${{ env.IMAGE }}@${{ fromJSON(needs.build-image.outputs.metadata).regular.digest }}
403+
```
404+
- Tags:
405+
```
406+
${{ join(fromJSON(needs.build-image.outputs.metadata).regular.tags, '
407+
') }}
408+
```
409+
410+
Debug variant:
411+
412+
- Digest:
413+
```
414+
${{ env.IMAGE }}@${{ fromJSON(needs.build-image.outputs.metadata).debug.digest }}
415+
```
416+
- Tags:
417+
```
418+
${{ join(fromJSON(needs.build-image.outputs.metadata).debug.tags, '
419+
') }}
420+
```
421+
422+
files: |
423+
artifacts/mas-cli-aarch64-linux.tar.gz
424+
artifacts/mas-cli-x86_64-linux.tar.gz
425+
prerelease: true
426+
make_latest: false

.github/workflows/ci.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -225,8 +225,8 @@ jobs:
225225

226226
- name: Install toolchain
227227
run: |
228-
rustup toolchain install 1.83.0
229-
rustup default 1.83.0
228+
rustup toolchain install 1.84.0
229+
rustup default 1.84.0
230230
rustup component add clippy
231231
232232
- name: Setup OPA
@@ -276,7 +276,7 @@ jobs:
276276
SQLX_OFFLINE: '1'
277277

278278
- name: Upload archive to workflow
279-
uses: actions/upload-artifact@v4.5.0
279+
uses: actions/upload-artifact@v4.6.0
280280
with:
281281
name: nextest-archive
282282
path: nextest-archive.tar.zst

.github/workflows/coverage.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
run: make coverage
3737

3838
- name: Upload to codecov.io
39-
uses: codecov/[email protected].1
39+
uses: codecov/[email protected].2
4040
with:
4141
token: ${{ secrets.CODECOV_TOKEN }}
4242
files: policies/coverage.json
@@ -74,7 +74,7 @@ jobs:
7474
run: npm run coverage
7575

7676
- name: Upload to codecov.io
77-
uses: codecov/[email protected].1
77+
uses: codecov/[email protected].2
7878
with:
7979
token: ${{ secrets.CODECOV_TOKEN }}
8080
directory: frontend/coverage/
@@ -161,7 +161,7 @@ jobs:
161161
grcov . --binary-path ./target/debug/deps/ -s . -t lcov --branch --ignore-not-existing --ignore '../*' --ignore "/*" -o target/coverage/tests.lcov
162162
163163
- name: Upload to codecov.io
164-
uses: codecov/[email protected].1
164+
uses: codecov/[email protected].2
165165
with:
166166
token: ${{ secrets.CODECOV_TOKEN }}
167167
files: target/coverage/*.lcov
Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
name: Create a new release branch
2+
on:
3+
workflow_dispatch:
4+
5+
jobs:
6+
compute-version:
7+
name: Compute the next minor RC version
8+
runs-on: ubuntu-22.04
9+
10+
permissions:
11+
contents: read
12+
13+
outputs:
14+
full: ${{ steps.next.outputs.version }}
15+
short: ${{ steps.next.outputs.short }}
16+
17+
steps:
18+
- name: Fail the workflow if this is not the main branch
19+
if: ${{ github.ref_name != 'main' }}
20+
run: exit 1
21+
22+
- name: Checkout the code
23+
uses: actions/[email protected]
24+
25+
- name: Install Rust toolchain
26+
run: |
27+
rustup toolchain install stable
28+
rustup default stable
29+
30+
- name: Compute the new minor RC
31+
id: next
32+
run: |
33+
CURRENT_VERSION="$(cargo metadata --format-version 1 | jq -r '.packages[] | select(.name == "mas-cli") | .version')"
34+
NEXT_VERSION="$(npx --yes [email protected] -i preminor --preid rc "${CURRENT_VERSION}")"
35+
# compute the short minor version, e.g. 0.1.0-rc.1 -> 0.1
36+
SHORT_VERSION="$(echo "${NEXT_VERSION}" | cut -d. -f1-2)"
37+
echo "full=${NEXT_VERSION}" >> "$GITHUB_OUTPUT"
38+
echo "short=${SHORT_VERSION}" >> "$GITHUB_OUTPUT"
39+
40+
localazy:
41+
name: Create a new branch in Localazy
42+
runs-on: ubuntu-22.04
43+
needs: [compute-version]
44+
45+
permissions:
46+
contents: read
47+
48+
steps:
49+
- name: Checkout the code
50+
uses: actions/[email protected]
51+
52+
- name: Install Node
53+
uses: actions/[email protected]
54+
with:
55+
node-version: 20
56+
57+
- name: Install Localazy CLI
58+
run: npm install -g @localazy/cli
59+
60+
- name: Create a new branch in Localazy
61+
run: localazy branch -w "$LOCALAZY_WRITE_KEY" create main "$BRANCH"
62+
env:
63+
LOCALAZY_WRITE_KEY: ${{ secrets.LOCALAZY_WRITE_KEY }}
64+
# Localazy doesn't like slashes in branch names, so we just use the short version
65+
# For example, a 0.13.0 release will create a localazy branch named "v0.13" and a git branch named "release/v0.13"
66+
BRANCH: v${{ needs.compute-version.outputs.short }}
67+
68+
tag:
69+
uses: ./.github/workflows/tag.yaml
70+
needs: [compute-version]
71+
with:
72+
version: ${{ needs.compute-version.outputs.full }}
73+
secrets:
74+
BOT_GITHUB_TOKEN: ${{ secrets.BOT_GITHUB_TOKEN }}
75+
76+
branch:
77+
name: Create a new release branch
78+
runs-on: ubuntu-22.04
79+
80+
permissions:
81+
contents: write
82+
83+
needs: [tag, compute-version, localazy]
84+
steps:
85+
- name: Create a new release branch
86+
uses: actions/[email protected]
87+
env:
88+
BRANCH: release/v${{ needs.compute-version.outputs.short }}
89+
SHA: ${{ needs.tag.outputs.sha }}
90+
with:
91+
github-token: ${{ secrets.BOT_GITHUB_TOKEN }}
92+
script: |
93+
const [owner, repo] = process.env.GITHUB_REPOSITORY.split('/');
94+
const branch = process.env.BRANCH;
95+
const sha = process.env.SHA;
96+
const ref = `heads/${branch}`;
97+
98+
await github.rest.git.createRef({
99+
owner,
100+
repo,
101+
ref,
102+
sha,
103+
});
104+
console.log(`Created branch ${branch} from ${sha}`);

0 commit comments

Comments
 (0)