ci: auto-publish Windows zip to Gitea Releases
ci / linux (clang) (push) Successful in 3m47s
ci / linux (gcc) (push) Successful in 4m25s
ci / musl (push) Successful in 4m34s
ci / windows-cross (push) Successful in 24m50s

After a successful windows-cross build on main or v* tags, upload the zip
and .sha256 via scripts/release_windows.sh (creates/updates v$VERSION).
Prefer secrets.RELEASE_TOKEN; fall back to GITHUB_TOKEN. Skip on PRs.
This commit is contained in:
WHC
2026-10-07 21:43:41 +08:00
parent 630e8f4295
commit 1772c26d43
4 changed files with 55 additions and 10 deletions
+21
View File
@@ -2,6 +2,8 @@ name: ci
on:
push:
branches: [main]
tags: ['v*']
pull_request:
concurrency:
@@ -112,3 +114,22 @@ jobs:
ls -lah dist/cst-agent-*-windows-x86_64.zip
cat dist/cst-agent-*-windows-x86_64.zip.sha256
unzip -l dist/cst-agent-*-windows-x86_64.zip | head -20
# Auto-publish to Gitea Releases (v$CST_VERSION from include/cst_version.h).
# Prefer repo secret RELEASE_TOKEN (write:repository); fall back to the
# job token. Skipped on pull_request and when no token is available.
- name: Publish Gitea Release
if: github.event_name == 'push'
env:
RELEASE_TOKEN: ${{ secrets.RELEASE_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CST_GITEA: ${{ github.server_url }}
CST_REPO: ${{ github.repository }}
GITHUB_REF: ${{ github.ref }}
CI: "true"
run: |
export GITEA_TOKEN="${RELEASE_TOKEN:-${GITHUB_TOKEN:-}}"
if [[ -z "${GITEA_TOKEN}" ]]; then
echo "::warning::no RELEASE_TOKEN / GITHUB_TOKEN; skip auto-release"
exit 0
fi
bash scripts/release_windows.sh