| 1 | #!/usr/bin/env bash |
| 2 | # Tag-pipeline publish step. |
| 3 | # |
| 4 | # Inspected BlueGit master on 6 November 2026 (api_routes.go, ops_ci.go |
| 5 | # opPublishRelease, release_replace.go checkReplace, gitrepo.Tag): |
| 6 | # there is no route that attaches artifacts to an existing git tag or an |
| 7 | # existing release. POST /api/v1/repos/{owner}/{repo}/releases always creates |
| 8 | # the annotated tag. An existing tag returns HTTP 409 unless replace=true, |
| 9 | # and replace=true is HTTP 403 on a tag pipeline. |
| 10 | # |
| 11 | # This script therefore does not call that endpoint and does not send |
| 12 | # replace. It exits 3 until BlueGit grows an attach route. It does not |
| 13 | # invent a second tag and it does not switch the pipeline onto a branch |
| 14 | # release. The required server change is recorded in design.md section 15. |
| 15 | set -euo pipefail |
| 16 | |
| 17 | : "${CI_API_URL:?}" "${CI_JOB_TOKEN:?}" "${CI_COMMIT_SHA:?}" "${CI_PROJECT_PATH:?}" "${CI_COMMIT_TAG:?}" |
| 18 | |
| 19 | root="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)" |
| 20 | cd "$root" |
| 21 | version="$(bash scripts/ci/package-version.sh)" |
| 22 | |
| 23 | echo "release-blocked: no-attach-endpoint" >&2 |
| 24 | echo "tag ${CI_COMMIT_TAG} version ${version} commit ${CI_COMMIT_SHA} project ${CI_PROJECT_PATH}" >&2 |
| 25 | echo "BlueGit has no request that publishes these package artifacts onto the tag that already started this pipeline." >&2 |
| 26 | echo "The create-release route would make a new annotated tag. This script does not call it." >&2 |
| 27 | echo "The overwrite flag is not sent. No second tag is created." >&2 |
| 28 | exit 3 |