Skip to content

Commit 1b28793

Browse files
committed
Implement release-request YAML release model
1 parent a338089 commit 1b28793

14 files changed

Lines changed: 1423 additions & 90 deletions

.github/workflows/ci.yml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
runs-on: ubuntu-latest
1414
steps:
1515
- name: Checkout sources
16-
uses: actions/checkout@v4
16+
uses: actions/checkout@v6
1717
with:
1818
submodules: true
1919

@@ -32,10 +32,13 @@ jobs:
3232
- name: Install protoc
3333
run: sudo provisioning/protoc.sh
3434

35-
- name: Setup just
36-
uses: extractions/setup-just@v3
37-
with:
38-
just-version: 1.40.0
35+
- name: Install just
36+
run: cargo install just --version 1.40.0 --locked
37+
env:
38+
CARGO_TARGET_DIR: /tmp/cargo-install-just
39+
40+
- name: Add cargo bin to PATH
41+
run: echo "$HOME/.cargo/bin" >> $GITHUB_PATH
3942

4043
- name: Check compilation
4144
run: cargo check

.github/workflows/docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
name: Build Docusaurus
1313
runs-on: ubuntu-latest
1414
steps:
15-
- uses: actions/checkout@v4
15+
- uses: actions/checkout@v6
1616
with:
1717
fetch-depth: 0
1818

.github/workflows/release-gate.yml

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
name: Release Gate
2+
on:
3+
pull_request:
4+
types: [closed]
5+
branches: [main]
6+
paths: ['.releases/**']
7+
8+
concurrency:
9+
group: release-gate
10+
cancel-in-progress: false
11+
12+
jobs:
13+
create-release-tag:
14+
name: Create tag and dispatch release
15+
runs-on: ubuntu-latest
16+
timeout-minutes: 5
17+
if: github.event.pull_request.merged == true
18+
permissions:
19+
contents: write
20+
actions: write
21+
steps:
22+
- name: Fail if App credentials are not configured
23+
run: |
24+
if [ -z "${{ secrets.APP_ID }}" ] || [ -z "${{ secrets.APP_PRIVATE_KEY }}" ]; then
25+
echo "❌ APP_ID and APP_PRIVATE_KEY must be configured."
26+
echo "For fork testing, install a personal GitHub App on the fork,"
27+
echo "create a private key, and add both as repository secrets."
28+
exit 1
29+
fi
30+
31+
- uses: actions/checkout@v6
32+
with:
33+
fetch-depth: 0
34+
35+
- uses: actions/create-github-app-token@v3
36+
id: app-token
37+
with:
38+
app-id: ${{ secrets.APP_ID }}
39+
private-key: ${{ secrets.APP_PRIVATE_KEY }}
40+
41+
- uses: actions/setup-python@v6
42+
with:
43+
python-version: '3.x'
44+
45+
- name: Install Python deps
46+
run: pip install pyyaml
47+
48+
- name: Create tag from release request
49+
id: gate
50+
env:
51+
GH_TOKEN: ${{ steps.app-token.outputs.token }}
52+
REPO: ${{ github.repository }}
53+
BASE_SHA: ${{ github.event.pull_request.base.sha }}
54+
MERGE_SHA: ${{ github.event.pull_request.merge_commit_sha }}
55+
run: |
56+
python .github/workflows/release/release.py gate | tee /tmp/gate-output.txt
57+
TAG=$(grep '^tag=' /tmp/gate-output.txt | tail -1 | cut -d= -f2-)
58+
COMMIT=$(grep '^commit=' /tmp/gate-output.txt | tail -1 | cut -d= -f2-)
59+
echo "tag=$TAG" >> $GITHUB_OUTPUT
60+
echo "commit=$COMMIT" >> $GITHUB_OUTPUT
61+
62+
if [ -z "$TAG" ] || [ -z "$COMMIT" ]; then
63+
echo "❌ gate did not emit tag= / commit= outputs"
64+
exit 1
65+
fi
66+
echo "Gate outputs: $TAG @ $COMMIT"
67+
68+
- name: Dispatch release workflow
69+
env:
70+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
71+
run: |
72+
gh workflow run release.yml \
73+
--ref main \
74+
-f tag=${{ steps.gate.outputs.tag }}

0 commit comments

Comments
 (0)