ci: publish the beta prerelease to Gitea from the tag lane
- fetch the pinned core CLI from git.cflmy.cn in Woodpecker instead of relying on GitHub access from the internal runner - add tools/release/publish-gitea.py: idempotent create/update of the prerelease for the tag and upload of archive, checksum, FILES.sha256, RELEASE_INFO.json and smoke evidence; token only from the environment - the tag-only Woodpecker lane now publishes through that script and fails closed when the GITEA_TOKEN repo secret is missing
This commit is contained in:
1 parent
97a1706317
commit
155d40393c
2 files changed
+225
-3
No files matched your search
+14
-3
@@ -34,7 +34,7 @@ steps:
|
||||
set -eu
|
||||
core_sha=4bbefc92449ee480c8a2c89b0308feb4cda8d0e7
|
||||
work=$(mktemp -d)
|
||||
git clone --quiet https://github.com/cflmy/marqdo-cli "$work/core"
|
||||
git clone --quiet https://git.cflmy.cn/cflmy/marqdo-cli.git "$work/core"
|
||||
( cd "$work/core" && git checkout --quiet "$core_sha" \
|
||||
&& cargo build --release --locked -p marqdo-cli )
|
||||
MARQDO_TEST_BIN="$work/core/target/release/marqdo" \
|
||||
@@ -54,13 +54,24 @@ steps:
|
||||
set -eu
|
||||
core_sha=4bbefc92449ee480c8a2c89b0308feb4cda8d0e7
|
||||
work=$(mktemp -d)
|
||||
git clone --quiet https://github.com/cflmy/marqdo-cli "$work/core"
|
||||
git clone --quiet https://git.cflmy.cn/cflmy/marqdo-cli.git "$work/core"
|
||||
( cd "$work/core" && git checkout --quiet "$core_sha" \
|
||||
&& cargo build --release --locked -p marqdo-cli )
|
||||
export MARQDO_BIN="$work/core/target/release/marqdo"
|
||||
version="$(python3 -c 'import re,pathlib;print(re.search(r"(?m)^version\s*=\s*\"([^\"]+)\"", pathlib.Path("Cargo.toml").read_text()).group(1))')"
|
||||
version="$(cargo metadata --no-deps --format-version 1 --offline \
|
||||
| python3 -c 'import json,sys; print(next(p["version"] for p in json.load(sys.stdin)["packages"] if p["name"]=="marqdo-knowledge"))')"
|
||||
python3 tools/release/package.py --source-sha "$CI_COMMIT_SHA" --version "$version"
|
||||
python3 tools/release/smoke.py --archive "dist/marqdo-knowledge-$version-x86_64-unknown-linux-gnu.tar.gz" --evidence-out dist/smoke-evidence.json
|
||||
if [ -z "${GITEA_TOKEN:-}" ]; then
|
||||
echo "GITEA_TOKEN secret is required for the release lane" >&2
|
||||
exit 2
|
||||
fi
|
||||
python3 tools/release/publish-gitea.py \
|
||||
--tag "$CI_COMMIT_TAG" \
|
||||
--archive "dist/marqdo-knowledge-$version-x86_64-unknown-linux-gnu.tar.gz" \
|
||||
--files dist/RELEASE_INFO.json dist/FILES.sha256 dist/smoke-evidence.json \
|
||||
--body-file "docs/releases/$version.md"
|
||||
- cat dist/RELEASE_INFO.json
|
||||
- cat dist/*.tar.gz.sha256
|
||||
- cat dist/smoke-evidence.json
|
||||
- cat dist/gitea-release-evidence.json
|
||||
Reference in new issue
Block a user