ci(release): auto-tag and publish aarch64+x86_64 on main
Some checks failed
ci / test (pull_request) Failing after 2m16s
Some checks failed
ci / test (pull_request) Failing after 2m16s
Drop the tag-push trigger so API-created tags cannot start a second run. Core paths on main (or workflow_dispatch) mint the next v*.*.* tag (v0.1.0 when none exist), build both arches in CI, and publish one release. dry_run builds without tagging. Fail closed on empty assets.
This commit is contained in:
parent
33beeded92
commit
111b95c3ae
5 changed files with 325 additions and 68 deletions
30
README.md
30
README.md
|
|
@ -25,7 +25,7 @@ Arti onion services are still **experimental**. If the hidden service cannot com
|
|||
|
||||
### Option A — download a release binary
|
||||
|
||||
CI (`.forgejo/workflows/release.yml`, Forgejo Actions on the Pi runner) builds the **aarch64** binary on every `v*.*.*` tag and attaches it to the [Forgejo release](https://forgejo.siriusdevops.com/sirius/onionwire/releases). There is no x86_64 runner on this instance, so the **x86_64** asset is built and uploaded by `scripts/build-release-local.sh` on an x86_64 host — both land on the same release page.
|
||||
CI (`.forgejo/workflows/release.yml`) tags and publishes both Linux binaries on every `main` push that touches the core (`src/`, `crates/`, `Cargo.toml`, `Cargo.lock`, or the release workflow/scripts). aarch64 builds on the Pi runner; x86_64 builds on the amd64 runner. Both attach to the same [Forgejo release](https://forgejo.siriusdevops.com/sirius/onionwire/releases). `scripts/build-release-local.sh` remains the offline x86_64 fallback.
|
||||
|
||||
**x86_64 (most PCs / VMs):**
|
||||
|
||||
|
|
@ -262,29 +262,27 @@ Every asset has a matching `.sha256` so `sha256sum -c` works. The APK is
|
|||
|
||||
## Releases (maintainers)
|
||||
|
||||
Tags trigger Forgejo Actions on the self-hosted Pi runner. The x86_64 asset has
|
||||
no runner on this instance, so it is built locally and attached to the same
|
||||
release.
|
||||
A core change on `main` is enough. The release workflow computes the next
|
||||
`v*.*.*` tag (patch+1, or `v0.1.0` if there are no tags), creates it via the
|
||||
API, builds aarch64 on the Pi runner and x86_64 on the amd64 runner, and
|
||||
publishes all four assets (`onionwire-<target>` + `.sha256`) to one release.
|
||||
Do not push tags by hand — a tag-push trigger would start a second run.
|
||||
|
||||
```bash
|
||||
# 1. version in Cargo.toml must match the tag without the leading v
|
||||
cargo update --offline -p onionwire # keep Cargo.lock at the new version
|
||||
git commit -am "chore: release vX.Y.Z" && git push origin main
|
||||
# optional: keep Cargo.toml in sync with the tag the workflow will mint
|
||||
# (the workflow does not edit Cargo.toml)
|
||||
|
||||
# 2. tag and push — the release workflow builds + publishes aarch64
|
||||
git tag -a vX.Y.Z -m "OnionWire vX.Y.Z"
|
||||
git push origin vX.Y.Z
|
||||
# rebuild / re-publish an existing tag, or dry-run a build with no tag:
|
||||
# Actions → release → Run workflow → tag=vX.Y.Z and/or dry_run=true
|
||||
|
||||
# 3. attach x86_64 from an x86_64 host (idempotent — safe to re-run)
|
||||
# offline x86_64 fallback (idempotent — safe to re-run)
|
||||
FORGEJO_TOKEN=<pat> scripts/build-release-local.sh vX.Y.Z
|
||||
```
|
||||
|
||||
Workflows (Forgejo Actions, `.forgejo/workflows/` — jobs run on the `docker`
|
||||
label of the Pi runner and do their Rust work in a `rust:1.91-bookworm`
|
||||
sibling container):
|
||||
Workflows (Forgejo Actions, `.forgejo/workflows/`):
|
||||
|
||||
- [`.forgejo/workflows/ci.yml`](.forgejo/workflows/ci.yml) — `cargo test --locked` + `cargo clippy --all-targets -- -D warnings` on `main` and PRs (ignored Tor-live tests are not run).
|
||||
- [`.forgejo/workflows/release.yml`](.forgejo/workflows/release.yml) — on `v*.*.*` tags: builds `aarch64-unknown-linux-gnu` natively, strips, sha256, publishes to the release. Also runnable via `workflow_dispatch` with a tag input to re-publish.
|
||||
- [`.forgejo/workflows/ci.yml`](.forgejo/workflows/ci.yml) — `cargo test --locked` + `cargo clippy --all-targets -- -D warnings` on `main` and PRs (ignored Tor-live tests are not run). Pi runner, `docker` label.
|
||||
- [`.forgejo/workflows/release.yml`](.forgejo/workflows/release.yml) — on core paths to `main`: next tag, aarch64 (`docker`) + x86_64 (`docker-amd64`), one release. `workflow_dispatch` rebuilds a tag or `dry_run`s. Concurrency group `onionwire-release` (separate from CI).
|
||||
|
||||
Scripts:
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue