Deliver tagged releases through native ReleaseKit CI
This commit is contained in:
@@ -1,9 +1,55 @@
|
|||||||
# Advisory validation after source publication, never a release-completion gate.
|
matrix:
|
||||||
|
include:
|
||||||
|
- GO_IMAGE: golang:1.27.0
|
||||||
|
|
||||||
when:
|
when:
|
||||||
- event: tag
|
- event: tag
|
||||||
|
ref: refs/tags/v*
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: validate-release
|
- name: deliver
|
||||||
image: golang:1.27.0
|
image: ${GO_IMAGE}
|
||||||
|
environment:
|
||||||
|
RELEASEKIT_GITEA_TOKEN:
|
||||||
|
from_secret: releasekit_gitea_token
|
||||||
commands:
|
commands:
|
||||||
- ./scripts/check-release-source.sh "$CI_COMMIT_TAG"
|
- |
|
||||||
|
set -eu
|
||||||
|
test -n "$${CI_COMMIT_TAG}"
|
||||||
|
test -n "$${CI_COMMIT_SHA}"
|
||||||
|
git check-ref-format "refs/tags/$${CI_COMMIT_TAG}"
|
||||||
|
git fetch origin "refs/tags/$${CI_COMMIT_TAG}:refs/tags/$${CI_COMMIT_TAG}"
|
||||||
|
tag_commit=$(git rev-parse --verify "refs/tags/$${CI_COMMIT_TAG}^{commit}")
|
||||||
|
expected_commit=$(git rev-parse --verify "$${CI_COMMIT_SHA}^{commit}")
|
||||||
|
if [ "$${tag_commit}" != "$${expected_commit}" ]; then
|
||||||
|
printf 'Tag %s resolves to commit %s; event %s resolves to commit %s\n' \
|
||||||
|
"$${CI_COMMIT_TAG}" "$${tag_commit}" "$${CI_COMMIT_SHA}" "$${expected_commit}" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
git checkout --detach "$${tag_commit}"
|
||||||
|
test "$(git rev-parse HEAD | tr '[:upper:]' '[:lower:]')" = "$${expected_commit}"
|
||||||
|
test -z "$(git status --porcelain --untracked-files=all)"
|
||||||
|
|
||||||
|
bootstrap_dir=$(mktemp -d "$${CI_WORKSPACE%/*}/.releasekit-bootstrap.XXXXXX")
|
||||||
|
trap 'rm -rf "$${bootstrap_dir}"' EXIT
|
||||||
|
cp go.mod "$${bootstrap_dir}/releasekit.mod"
|
||||||
|
if [ -f go.sum ]; then
|
||||||
|
cp go.sum "$${bootstrap_dir}/releasekit.sum"
|
||||||
|
else
|
||||||
|
: > "$${bootstrap_dir}/releasekit.sum"
|
||||||
|
fi
|
||||||
|
|
||||||
|
export GOWORK=off
|
||||||
|
export GOTOOLCHAIN=local
|
||||||
|
releasekit_host_os=$(go env GOHOSTOS) || exit $?
|
||||||
|
releasekit_host_arch=$(go env GOHOSTARCH) || exit $?
|
||||||
|
export GOOS="$${releasekit_host_os}" GOARCH="$${releasekit_host_arch}"
|
||||||
|
releasekit_module=go.maximumdirect.net/releasekit
|
||||||
|
go list -mod=mod -modfile="$${bootstrap_dir}/releasekit.mod" -m "$${releasekit_module}"
|
||||||
|
go mod edit -modfile="$${bootstrap_dir}/releasekit.mod" -tool="$${releasekit_module}/cmd/releasekit"
|
||||||
|
go list -mod=mod -modfile="$${bootstrap_dir}/releasekit.mod" -deps "$${releasekit_module}/cmd/releasekit" > /dev/null
|
||||||
|
go tool -modfile="$${bootstrap_dir}/releasekit.mod" "$${releasekit_module}/cmd/releasekit" ci-deliver \
|
||||||
|
--repo "$${CI_WORKSPACE}" \
|
||||||
|
--prepared \
|
||||||
|
--commit "$${expected_commit}" \
|
||||||
|
"$${CI_COMMIT_TAG}"
|
||||||
|
|||||||
@@ -26,7 +26,8 @@ License and notices: [CC BY-SA 4.0](licenses/CC-BY-SA-4.0.txt) |
|
|||||||
## ReleaseKit
|
## ReleaseKit
|
||||||
|
|
||||||
Selected module: `go.maximumdirect.net/releasekit` at `v0.10.0`.
|
Selected module: `go.maximumdirect.net/releasekit` at `v0.10.0`.
|
||||||
Material: `scripts/releasekit`, adapted from the adoption guide.
|
Material: `scripts/releasekit` and `.woodpecker/release.yml`, adapted from the
|
||||||
|
adoption guide and tag-delivery example.
|
||||||
|
|
||||||
Copyright (C) 2026 Eric Rakestraw
|
Copyright (C) 2026 Eric Rakestraw
|
||||||
|
|
||||||
|
|||||||
@@ -159,6 +159,10 @@ CI references may remain temporarily until their owning stages below.
|
|||||||
|
|
||||||
## Stage 4: Replace Advisory Tag CI With Native Delivery
|
## Stage 4: Replace Advisory Tag CI With Native Delivery
|
||||||
|
|
||||||
|
**Status: Complete.** The YAML and secret mapping were checked locally; the
|
||||||
|
bootstrap matches the selected template except for the chosen Go image. CI
|
||||||
|
secret provisioning and remote access remain external operator setup.
|
||||||
|
|
||||||
**Goal:** Deliver the committed release note and Linux/amd64 assets through
|
**Goal:** Deliver the committed release note and Linux/amd64 assets through
|
||||||
ReleaseKit's maintained consumer bootstrap.
|
ReleaseKit's maintained consumer bootstrap.
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user