mirror of
https://github.com/brues-code/ClassicAPI.git
synced 2026-11-16 08:00:42 +00:00
A Gitea pull mirror replicates commits and tags only. A release is a database record with its own attachments, so it never crosses: the mirror's Releases page shows bare tags with nothing to download. Push them over through Gitea's API instead. The new workflow ensures the tag is on the mirror (forcing a mirror-sync and waiting if it is not), then creates the release -- or promotes the bare tag record Gitea's own sync left behind -- and uploads each asset, replacing one whose size no longer matches. The files come from the GitHub release rather than a rebuild, so both hosts serve identical bytes. `Build` calls it after every release build. Running it from the Actions UI with a tag redoes one release; with the tag blank it backfills every release on GitHub. A `release: published` trigger cannot work here -- releases created with the default GITHUB_TOKEN do not start another workflow -- hence the `needs: build` job. Endpoints, payload fields and status codes verified against the instance's own swagger (Gitea 1.26.4). Needs a MIRROR_TOKEN secret holding a mirror token with `repository` write. Without it the mirror job fails with that instruction, leaving the already-published GitHub release untouched.