Skip to content

Commit ce4f39d

Browse files
committed
docs+ci: update publishing docs and workflows with real artifact locations
- docs/07-cicd-publishing.md: complete rewrite with real publication URLs, CLI binary targets table, Python wheel coverage matrix, Homebrew install instructions, local Makefile publish workflow, HOMEBREW_TAP_TOKEN setup - release-cli.yml (new): builds 5-arch CLI binaries, attaches to GitHub Release, generates and pushes Homebrew formula (requires HOMEBREW_TAP_TOKEN) - release-node.yml: replace cross with cargo-zigbuild for Linux ARM64 (no Docker dependency; works on macOS and Linux CI runners) - release-python.yml: build multiple Python versions on macOS/Windows (install 3.10-3.13 via setup-python; pass -i interpreters to maturin) - Makefile: fix publish-cli-dry to show x86_64-pc-windows-gnu (not msvc)
1 parent aca7b6b commit ce4f39d

5 files changed

Lines changed: 392 additions & 62 deletions

File tree

.github/workflows/release-cli.yml

Lines changed: 166 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,166 @@
1+
name: Release — CLI Binaries + Homebrew
2+
3+
# Builds the edgeparse CLI for all 5 target platforms, attaches the
4+
# tarballs/zips to the GitHub Release created by release-rust.yml, then
5+
# generates and pushes the Homebrew formula to the tap repository.
6+
#
7+
# Required secrets:
8+
# HOMEBREW_TAP_TOKEN — GitHub PAT with `contents: write` access to
9+
# raphaelmansuy/homebrew-edgeparse
10+
11+
on:
12+
push:
13+
tags: ['v[0-9]+.[0-9]+.[0-9]+']
14+
15+
permissions:
16+
contents: write
17+
18+
jobs:
19+
# ── Build per-platform ─────────────────────────────────────────────────────
20+
build-cli:
21+
name: Build CLI — ${{ matrix.target }}
22+
runs-on: ${{ matrix.runner }}
23+
strategy:
24+
fail-fast: false
25+
matrix:
26+
include:
27+
- target: aarch64-apple-darwin
28+
runner: macos-14
29+
- target: x86_64-apple-darwin
30+
runner: macos-13
31+
- target: x86_64-unknown-linux-gnu
32+
runner: ubuntu-latest
33+
- target: aarch64-unknown-linux-gnu
34+
runner: ubuntu-latest
35+
use-zigbuild: true
36+
- target: x86_64-pc-windows-gnu
37+
runner: ubuntu-latest
38+
use-zigbuild: true
39+
40+
steps:
41+
- uses: actions/checkout@v4
42+
43+
- uses: dtolnay/rust-toolchain@stable
44+
with:
45+
targets: ${{ matrix.target }}
46+
47+
- uses: Swatinem/rust-cache@v2
48+
with:
49+
key: cli-${{ matrix.target }}
50+
51+
- name: Install zig + cargo-zigbuild (Linux/Windows cross)
52+
if: matrix.use-zigbuild
53+
run: |
54+
pip install ziglang
55+
cargo install cargo-zigbuild --locked
56+
57+
- name: Build CLI binary
58+
shell: bash
59+
run: |
60+
TARGET="${{ matrix.target }}"
61+
if [[ "${{ matrix.use-zigbuild }}" == "true" ]]; then
62+
# Pin glibc to 2.17 for maximum Linux compatibility
63+
cargo zigbuild --release --target "${TARGET}.2.17" -p edgeparse-cli
64+
else
65+
cargo build --release --target "${TARGET}" -p edgeparse-cli
66+
fi
67+
68+
- name: Package artifact
69+
shell: bash
70+
run: |
71+
VERSION="${GITHUB_REF_NAME#v}"
72+
TARGET="${{ matrix.target }}"
73+
mkdir -p release-dist
74+
75+
if [[ "$TARGET" == *"windows"* ]]; then
76+
cp "target/${TARGET}/release/edgeparse.exe" release-dist/
77+
zip -j "release-dist/edgeparse-${VERSION}-${TARGET}.zip" \
78+
release-dist/edgeparse.exe README.md LICENSE
79+
rm release-dist/edgeparse.exe
80+
else
81+
cp "target/${TARGET}/release/edgeparse" release-dist/
82+
tar -czf "release-dist/edgeparse-${VERSION}-${TARGET}.tar.gz" \
83+
-C release-dist edgeparse \
84+
-C "$GITHUB_WORKSPACE" README.md LICENSE
85+
rm release-dist/edgeparse
86+
fi
87+
88+
- uses: actions/upload-artifact@v4
89+
with:
90+
name: cli-${{ matrix.target }}
91+
path: release-dist/
92+
93+
# ── Attach to GitHub Release ───────────────────────────────────────────────
94+
attach-release:
95+
name: Attach CLI binaries to GitHub Release
96+
needs: build-cli
97+
runs-on: ubuntu-latest
98+
steps:
99+
- uses: actions/download-artifact@v4
100+
with:
101+
merge-multiple: true
102+
path: release-dist/
103+
104+
- name: Ensure GitHub Release exists
105+
env:
106+
GH_TOKEN: ${{ github.token }}
107+
run: |
108+
gh release view "${{ github.ref_name }}" \
109+
--repo "${{ github.repository }}" >/dev/null 2>&1 \
110+
|| gh release create "${{ github.ref_name }}" \
111+
--repo "${{ github.repository }}" \
112+
--title "${{ github.ref_name }}" \
113+
--notes "CLI binaries for ${{ github.ref_name }}"
114+
115+
- name: Upload CLI artifacts
116+
env:
117+
GH_TOKEN: ${{ github.token }}
118+
run: |
119+
for f in release-dist/*.tar.gz release-dist/*.zip; do
120+
[ -f "$f" ] || continue
121+
echo "Uploading: $f"
122+
gh release upload "${{ github.ref_name }}" "$f" \
123+
--repo "${{ github.repository }}" --clobber
124+
done
125+
126+
# ── Update Homebrew formula ────────────────────────────────────────────────
127+
homebrew:
128+
name: Update Homebrew tap formula
129+
needs: attach-release
130+
runs-on: ubuntu-latest
131+
# Only run when HOMEBREW_TAP_TOKEN is configured
132+
if: ${{ secrets.HOMEBREW_TAP_TOKEN != '' }}
133+
steps:
134+
- uses: actions/checkout@v4
135+
136+
# Download built artifacts so gen-formula.sh can read local SHA256s
137+
- uses: actions/download-artifact@v4
138+
with:
139+
merge-multiple: true
140+
path: target/release-dist/
141+
142+
- name: Generate Homebrew formula
143+
run: |
144+
mkdir -p Formula
145+
bash scripts/gen-formula.sh "${GITHUB_REF_NAME#v}" Formula/edgeparse.rb
146+
echo "--- Generated formula ---"
147+
cat Formula/edgeparse.rb
148+
149+
- name: Push formula to tap
150+
env:
151+
GH_TOKEN: ${{ secrets.HOMEBREW_TAP_TOKEN }}
152+
run: |
153+
TAPDIR=$(mktemp -d)
154+
git clone \
155+
"https://x-access-token:${GH_TOKEN}@github.com/raphaelmansuy/homebrew-edgeparse.git" \
156+
"$TAPDIR"
157+
mkdir -p "$TAPDIR/Formula"
158+
cp Formula/edgeparse.rb "$TAPDIR/Formula/edgeparse.rb"
159+
cd "$TAPDIR"
160+
git config user.email "actions@github.com"
161+
git config user.name "EdgeParse Release Bot"
162+
git add Formula/edgeparse.rb
163+
git diff --cached --quiet \
164+
&& echo "Formula unchanged, nothing to push." \
165+
|| git commit -m "edgeparse ${GITHUB_REF_NAME#v}" && git push origin HEAD
166+
rm -rf "$TAPDIR"

.github/workflows/release-node.yml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
- target: aarch64-unknown-linux-gnu
2222
runner: ubuntu-latest
2323
node-platform: linux-arm64-gnu
24-
use-cross: true
24+
use-zigbuild: true
2525
- target: x86_64-apple-darwin
2626
runner: macos-13
2727
node-platform: darwin-x64
@@ -38,14 +38,16 @@ jobs:
3838
with: { targets: '${{ matrix.target }}' }
3939
- uses: Swatinem/rust-cache@v2
4040

41-
- name: Install cross (for aarch64 Linux)
42-
if: matrix.use-cross
43-
run: cargo install cross --locked
41+
- name: Install zig + cargo-zigbuild (for aarch64 Linux cross)
42+
if: matrix.use-zigbuild
43+
run: |
44+
pip install ziglang
45+
cargo install cargo-zigbuild --locked
4446
4547
- name: Build Rust binding
4648
run: |
47-
if [[ "${{ matrix.use-cross }}" == "true" ]]; then
48-
cross build --release --target ${{ matrix.target }} -p edgeparse-node
49+
if [[ "${{ matrix.use-zigbuild }}" == "true" ]]; then
50+
cargo zigbuild --release --target ${{ matrix.target }}.2.17 -p edgeparse-node
4951
else
5052
cargo build --release --target ${{ matrix.target }} -p edgeparse-node
5153
fi

.github/workflows/release-python.yml

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,21 @@ jobs:
3535
steps:
3636
- uses: actions/checkout@v4
3737

38+
# Linux: maturin-action builds all Python versions automatically via
39+
# the manylinux container (cp310–cp313).
40+
# macOS: install multiple interpreters so maturin produces one wheel
41+
# per Python version per arch.
3842
- uses: actions/setup-python@v5
43+
if: ${{ !startsWith(matrix.platform.runner, 'ubuntu') }}
44+
with:
45+
python-version: |
46+
3.10
47+
3.11
48+
3.12
49+
3.13
50+
51+
- uses: actions/setup-python@v5
52+
if: startsWith(matrix.platform.runner, 'ubuntu')
3953
with:
4054
python-version: '3.12'
4155

@@ -45,7 +59,9 @@ jobs:
4559
target: ${{ matrix.platform.target }}
4660
manylinux: ${{ matrix.platform.manylinux }}
4761
working-directory: sdks/python
48-
args: --release --out dist/
62+
args: >-
63+
--release --out dist/
64+
${{ !startsWith(matrix.platform.runner, 'ubuntu') && '-i python3.10 python3.11 python3.12 python3.13' || '' }}
4965
sccache: 'true'
5066

5167
- name: Upload wheel artifact

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,7 @@ publish-cli-dry: ## Dry-run: show all CLI artifacts that would be built
411411
@printf " $(CYAN)x86_64-apple-darwin$(RESET) → edgeparse-$(VERSION)-x86_64-apple-darwin.tar.gz\n"
412412
@printf " $(CYAN)x86_64-unknown-linux-gnu$(RESET) → edgeparse-$(VERSION)-x86_64-unknown-linux-gnu.tar.gz\n"
413413
@printf " $(CYAN)aarch64-unknown-linux-gnu$(RESET) → edgeparse-$(VERSION)-aarch64-unknown-linux-gnu.tar.gz\n"
414-
@printf " $(CYAN)x86_64-pc-windows-msvc$(RESET) → edgeparse-$(VERSION)-x86_64-pc-windows-msvc.zip (skipped if Docker unavailable)\n"
414+
@printf " $(CYAN)x86_64-pc-windows-gnu$(RESET) → edgeparse-$(VERSION)-x86_64-pc-windows-gnu.zip (skipped if cargo-zigbuild unavailable)\n"
415415
$(call ok,CLI dry-run — artifacts would be uploaded to GitHub Release v$(VERSION))
416416

417417
publish-cli: ## Build all-arch CLI binaries and attach to GitHub Release v$(VERSION)

0 commit comments

Comments
 (0)