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
name: Release
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
# ── Build native macOS arm64 binary ───────────────────────────
#
# Runs on an Apple Silicon runner (macos-14 = M1). We do NOT
# cross-compile from Linux: oxios pulls in oxi-sdk/wasmtime with a
# native JIT and C dependencies that are painful to cross to
# aarch64-apple-darwin. The binary does NOT embed web assets
# (RFC-026 removed rust-embed) — it fetches web-dist.zip on first
# run into ~/.oxios/web/dist/ — so the tarball is just the
# standalone `oxios` executable.
#
# `needs: release` so this uploads to the release the `release` job
# already created — one owner of release creation, no upload race.
binary:
name: Build macOS arm64 binary
needs: release
runs-on: macos-14
permissions:
contents: write
steps:
- uses: actions/checkout@v5
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Build dist binary
run: cargo build --profile dist --locked
- name: Smoke test
run: ./target/dist/oxios --version
- name: Package and checksum
run: |
set -euo pipefail
ASSET=oxios-aarch64-apple-darwin.tar.gz
tar -C target/dist -czf "$ASSET" oxios
shasum -a 256 "$ASSET" > "$ASSET.sha256"
ls -lh "$ASSET" "$ASSET.sha256"
- name: Upload binary to release
uses: softprops/action-gh-release@v2
with:
files: |
oxios-aarch64-apple-darwin.tar.gz
oxios-aarch64-apple-darwin.tar.gz.sha256
# ── 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"