Vendor the root component-release helpers, add source packaging plus release-evidence, and split publish (tag/manual) from notify (release event).
35 lines
1.2 KiB
YAML
35 lines
1.2 KiB
YAML
# 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
|