ci: add protected component publish workflow and immutable release helpers
ci/woodpecker/push/ci Pipeline was successful
ci/woodpecker/pr/ci Pipeline was successful

Vendor the root component-release helpers, add source packaging plus
release-evidence, and split publish (tag/manual) from notify (release event).
This commit is contained in:
cflmy committed 2026-11-27 19:23:00 +08:00
1 parent 0775c1af3c
commit e48275df1c
9 files changed
+865 -8

No files matched your search

+34
View File
@@ -0,0 +1,34 @@
# Protected publish workflow: tag or manual only.
when:
- event: [tag, manual]
steps:
publish:
image: git.cflmy.cn/cflmy/marqdo-ci-shell:3.0.0-rc.5
environment:
GITEA_PUBLISH_TOKEN:
from_secret: gitea_publish_token
COMPONENT_ID: std-data
REPOSITORY: cflmy/marqdo-std-data
commands:
- |
set -eu
test -n "${GITEA_PUBLISH_TOKEN:?gitea_publish_token secret missing}"
test -n "${CI_COMMIT_TAG:?publish requires a tag}"
export SOURCE_SHA="${CI_COMMIT_SHA}"
export VERSION="${CI_COMMIT_TAG#v}"
export TAG="${CI_COMMIT_TAG}"
export COMPONENT_ID=std-data
export REPOSITORY=cflmy/marqdo-std-data
sh scripts/package.sh
ARCHIVE="dist/marqdo-std-data-${VERSION}-source.tar.gz"
python3 scripts/release/publish_gitea.py \
--repo "cflmy/marqdo-std-data" \
--tag "$TAG" \
--target "$SOURCE_SHA" \
--prerelease \
--body "Automated source release for std-data $TAG." \
--asset "$ARCHIVE" \
--asset "${ARCHIVE}.sha256" \
--asset dist/release-evidence.json \
--evidence-out dist/gitea-publish-result.json
+7 -8
View File
@@ -1,7 +1,4 @@
# Fast-path notification: a completed Gitea release asks the root reconcile
# workflow to check it. The payload is only a hint; the root reconcile verifies
# the release/assets from the authoritative Gitea API. A lost call is recovered
# by the root `release-reconcile` cron.
# Fast-path notification after a completed Gitea release.
when:
event: [release]
@@ -9,10 +6,12 @@ steps:
notify:
image: git.cflmy.cn/cflmy/marqdo-ci-shell:3.0.0-rc.5
environment:
WOODPECKER_TOKEN:
from_secret: woodpecker_token
WOODPECKER_NOTIFY_TOKEN:
from_secret: woodpecker_notify_token
commands:
- |
set -eu
test -n "${WOODPECKER_TOKEN:?woodpecker_token secret missing}"
curl -fsS -X POST -H "Authorization: Bearer $WOODPECKER_TOKEN" -H "Content-Type: application/json" -d '{"branch":"main","workflow":"reconcile"}' https://ci.cflmy.cn/api/repos/6/pipelines
test -n "${WOODPECKER_NOTIFY_TOKEN:?woodpecker_notify_token secret missing}"
python3 scripts/release/notify_root.py \
--hint-component "std-data" \
--hint-tag "${CI_COMMIT_TAG:-}"