138 lines
6.6 KiB
Markdown
138 lines
6.6 KiB
Markdown
# Echoion releases on Gitea
|
|
|
|
Echoion release builds run only through `scripts/release.sh`, whose default
|
|
mode builds, tests, validates, and packages inside
|
|
`containers/release.Dockerfile`. The runner host only checks out sources and
|
|
controls Docker; the workflow never starts `echoiond`.
|
|
|
|
## One-time Gitea setup
|
|
|
|
Register exactly one trusted Linux AMD64 Actions runner with the
|
|
`echoion-release` label and Docker access. Using one runner serializes release
|
|
and feed writes on Gitea versions that do not implement workflow
|
|
`concurrency`. Do not attach this label to runners serving untrusted
|
|
repositories. The runner host needs Bash, Git with SSH-signature support,
|
|
OpenSSH client tools, Python 3.10 or newer, OpenSSL with Ed25519 support,
|
|
coreutils, and Docker. The release builder itself remains containerized.
|
|
|
|
The Docker-capable runner executes only protected `main` pushes, manual runs,
|
|
scheduled nightlies, and signed release tags. The container CI workflow does
|
|
not run for pull requests because contributor-controlled scripts must not
|
|
receive a privileged Docker socket or the private-submodule checkout key. If
|
|
pre-merge CI is required, register a separate ephemeral `echoion-pr` runner
|
|
without release secrets or host-level Docker access and give it a dedicated
|
|
workflow.
|
|
|
|
Enable Actions and add these repository secrets:
|
|
|
|
| Secret | Purpose |
|
|
| --- | --- |
|
|
| `RELEASE_CHECKOUT_SSH_KEY` | Read-only deploy key that can clone every private nested repository in `.gitmodules`. |
|
|
| `RELEASE_BOT_TOKEN` | PAT owned by a dedicated bot, limited to writing releases, tags, and the `release-feed` branch in this repository. |
|
|
| `RELEASE_TAG_ALLOWED_SIGNERS` | Complete OpenSSH `allowed_signers` lines for maintainers allowed to publish `v*` tags. |
|
|
| `RELEASE_FEED_ED25519_PRIVATE_KEY` | PEM private key matching `release-keys/echoion-release-2026-07.pub.pem`. Preserve its newlines. |
|
|
|
|
The release PAT must not be shared with checkout of nested repositories. The
|
|
feed signing key must not be stored in Git, runner images, Actions variables,
|
|
or release assets.
|
|
|
|
Create an orphan `release-feed` branch containing a tracked `feeds/`
|
|
directory, then protect it so only the release bot can push. Protect the `v*`
|
|
tag pattern so only the release maintainers represented by
|
|
`RELEASE_TAG_ALLOWED_SIGNERS` can create, update, or delete matching tags. The
|
|
workflow requires the exact `v*` rule to have an explicit non-empty user or
|
|
team allowlist. Gitea uses the same allowlist for tag creation and later tag
|
|
changes; when immutable release tags are required, add a server-side
|
|
pre-receive policy that rejects updates and deletion after creation. Protect
|
|
`main` in the normal way.
|
|
|
|
The updater feed URL is:
|
|
|
|
```text
|
|
https://<gitea>/<owner>/<repo>/raw/branch/release-feed/feeds/echoion-runtime.json
|
|
```
|
|
|
|
The embedded updater trust configuration is represented by
|
|
`release-keys/official-update-keys.json`. `scripts/release.sh` validates and
|
|
embeds that JSON automatically. Release workflows also pass the HTTPS
|
|
`release-feed` branch URL through `--official-update-feed-url`, so a fresh
|
|
installation has a signed official source without operator-side duplication.
|
|
|
|
## Stable and beta releases
|
|
|
|
Create an annotated SSH-signed tag. A version without a prerelease suffix goes
|
|
to `stable`; any strict SemVer prerelease goes to `beta`.
|
|
|
|
```bash
|
|
git config gpg.format ssh
|
|
git config user.signingkey ~/.ssh/echoion-release-maintainer.pub
|
|
git tag -s -a v1.2.3 -m 'Echoion 1.2.3'
|
|
git push origin v1.2.3
|
|
```
|
|
|
|
`.gitea/workflows/release.yml` rejects a lightweight tag, a non-SSH
|
|
signature, an untrusted signer, a repository without the exact `v*` protected
|
|
tag rule and explicit allowlist, a non-SemVer name, an event object unrelated
|
|
to the tag, or a checkout whose commit differs from the signed tag target.
|
|
Release notes contain the signed tag subject and body but not its SSH signature
|
|
armor.
|
|
|
|
The workflow creates or resumes a draft, replaces incomplete draft assets,
|
|
uploads every file in `dist/`, downloads every asset through Gitea, checks
|
|
its size and SHA-256, and only then publishes. A rerun against an already
|
|
published release is read-only and succeeds only when all remote assets still
|
|
match. The signed aggregate feed is committed after release publication; a
|
|
feed failure can therefore be retried without replacing a published release.
|
|
|
|
## Nightly releases
|
|
|
|
`.gitea/workflows/nightly.yml` runs at 02:17 UTC and can also be dispatched
|
|
manually. Nightly versions use
|
|
`0.0.0-nightly.YYYYMMDD.RUN_NUMBER`, publish as prereleases on the `nightly`
|
|
channel, and keep the newest 14 Gitea releases. The aggregate feed also keeps
|
|
the newest 14 distinct nightly versions while retaining stable and beta
|
|
records.
|
|
|
|
Every aggregate envelope expires 45 days after generation. Scheduled
|
|
nightlies normally refresh it daily. Alert when the feed branch has not
|
|
advanced for more than seven days, and treat 30 days without a successful
|
|
signing run as urgent.
|
|
|
|
## Feed key custody and rotation
|
|
|
|
The active public key id is `echoion-release-2026-07`. To rotate, generate the
|
|
private key on a trusted operator machine:
|
|
|
|
```bash
|
|
umask 077
|
|
openssl genpkey -algorithm ED25519 -out echoion-release-YYYY-MM.pem
|
|
openssl pkey -in echoion-release-YYYY-MM.pem -pubout \
|
|
-out echoion-release-YYYY-MM.pub.pem
|
|
```
|
|
|
|
Add the new public key to official builds before signing any feed with it.
|
|
Keep the old public key embedded for at least one full update lifetime. During
|
|
the first signing run with the new key, pass each prior envelope key explicitly
|
|
to `aggregate_update_feed.py` as
|
|
`--trusted-existing-key OLD_KEY_ID=OLD_PUBLIC_KEY_PATH`; this permits only
|
|
verification of the old envelope and never selects the old key for signing.
|
|
Update the signing key id and public-key paths in both release workflows, add
|
|
the old-key verification argument while an old envelope may exist, and replace
|
|
the private-key secret. The merger verifies the newly generated signature
|
|
against the new committed public key before writing either output. Never print
|
|
the private key or pass it as a command-line argument.
|
|
|
|
## Recovery rules
|
|
|
|
- A failed build creates no Gitea release.
|
|
- A failed upload leaves a draft. Rerun the same workflow to replace the
|
|
partial draft assets.
|
|
- A failed verification never publishes the draft.
|
|
- A published release with mismatched assets is immutable; investigate and
|
|
create a new version instead of replacing it.
|
|
- A failed feed push leaves the published release available but undiscoverable
|
|
to auto-update. Rerun the workflow; publication verification is idempotent
|
|
and the feed step will run again.
|
|
- Never edit `release-feed` manually. The merger verifies the existing
|
|
Ed25519 envelope before using any prior entries.
|