# Protected publish workflow: tag or manual only. # Holds the publish token. Push/PR lanes must never mount this secret. 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: "${COMPONENT_ID}" REPOSITORY: "${REPOSITORY}" 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}" sh scripts/package.sh ARCHIVE="dist/marqdo-${COMPONENT_ID}-${VERSION}-source.tar.gz" python3 scripts/release/publish_gitea.py \ --repo "$REPOSITORY" \ --tag "$TAG" \ --target "$SOURCE_SHA" \ --prerelease \ --body "Automated source release for ${COMPONENT_ID} ${TAG}." \ --asset "$ARCHIVE" \ --asset "${ARCHIVE}.sha256" \ --asset dist/release-evidence.json \ --evidence-out dist/gitea-publish-result.json