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
name: Release (Web UI)
on:
push:
tags:
- 'v*'
permissions:
contents: read
# `actions: write` lets the `trigger-publish` job dispatch publish.yml
# via `gh workflow run` (same-repo dispatch works with GITHUB_TOKEN).
actions: write
jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v5
- uses: oven-sh/setup-bun@v2
# ─── Build web assets ──────────────────────────────────────────
- name: Build web assets
working-directory: web
run: bun install && bun run build
# ─── Package and create GitHub Release ───────────────────────
- name: Package web assets
run: |
cd web/dist
zip -r $GITHUB_WORKSPACE/web-dist.zip .
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
files: web-dist.zip
generate_release_notes: true
# ── Trigger crates.io publish ──────────────────────────────────
# A Release created with GITHUB_TOKEN does NOT emit a `release: published`
# event to other workflows (GitHub suppresses this to prevent loops), so
# publish.yml's `on: release` trigger never fires. Dispatch it explicitly
# here once the Release is live. publish.yml verifies the Release exists
# before publishing.
trigger-publish:
name: Trigger crates.io publish
needs: release
runs-on: ubuntu-latest
steps:
# `gh workflow run` resolves the target workflow file from the *local*
# git checkout, so it needs an actions/checkout step. Without it the
# job fails with `fatal: not a git repository`.
- uses: actions/checkout@v5
- name: Dispatch publish workflow
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh workflow run publish.yml -f dry_run=false
echo "publish.yml dispatched for $GITHUB_REF_NAME"