ci(release): auto-publish split bundles to Gitea package registry on version tags

.gitea/workflows/release.yml — on push tag v*: assert tag==VERSION, run the governance
gate (must be green), build core/devkit/platform-preview/all-in-one-demo (enterprise
skipped/refused), then PUT each .tar.gz (+.sha256) to the Gitea generic package registry
using ${{ secrets.GITEA_TOKEN }}. Portable via GITHUB_SERVER_URL/OWNER. Guide updated with
the one-time secret setup + release flow.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
thanhnv
2026-07-08 16:06:28 +09:00
co-authored by Claude Opus 4.8
parent 6cb96ce249
commit 98d699d844
2 changed files with 104 additions and 4 deletions
+26 -4
View File
@@ -67,7 +67,29 @@ curl -fsSL -XPOST -H "Authorization: token $GITEA_TOKEN" \
`platform` as `-preview`, `all-in-one-demo` for demos. Never publish `enterprise`.
- Keep `VERSION` and `packages/casan-harness/level5/harness-package.json` version in lockstep.
## Automating in CI
Add a release job to `.gitea/workflows/` that runs after the gate, calls
`scripts/package-release.sh`, and does the `curl` uploads with `${{ secrets.GITEA_TOKEN }}`.
Keep it gated on tags (`on: push: tags: ['v*']`) so ordinary pushes don't publish.
## Automated release (recommended — already wired)
`.gitea/workflows/release.yml` does all of the above automatically on a version tag. You
never hand a token to anyone — it lives in a CI secret.
**One-time setup**
1. Create a token: Gitea → *Settings → Applications → Generate New Token*, scope
`write:package` (+ `write:repository` if you also want release attachments).
2. Add it as a secret: repo (or org) → *Settings → Actions → Secrets* → name `GITEA_TOKEN`.
**Cut a release**
```bash
# bump the version everywhere first
echo 1.0.1 > VERSION # must match the tag
# (also bump packages/casan-harness/level5/harness-package.json "version")
git commit -am "release v1.0.1"
git tag -a v1.0.1 -m "CASAN v1.0.1"
git push origin main --follow-tags
```
On the tag push the workflow: checks `tag == VERSION` → runs the governance gate (must be
green) → builds `core`/`devkit`/`platform-preview`/`all-in-one-demo` (enterprise skipped) →
`curl` PUTs each `.tar.gz` (+ `.sha256`) to `.../api/packages/<owner>/generic/...`. Bundles
appear under the repo's **Packages** tab. `GITHUB_SERVER_URL` / `GITHUB_REPOSITORY_OWNER`
are provided by Gitea Actions, so the workflow is portable across Gitea hosts.
## Manual one-off (if you don't want to tag)
Use the `curl` snippets in §2/§3 above with a local `GITEA_TOKEN`.