Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 21 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,29 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release create "${GITHUB_REF_NAME}" \
set +e
create_out=$(gh release create "${GITHUB_REF_NAME}" \
--repo "${GITHUB_REPOSITORY}" \
--title "busbar-hashicorp-vault ${GITHUB_REF_NAME}" \
--verify-tag --generate-notes \
|| gh release view "${GITHUB_REF_NAME}" --repo "${GITHUB_REPOSITORY}"
--verify-tag --generate-notes 2>&1)
status=$?
set -e
echo "$create_out"
if [ "$status" -eq 0 ]; then
exit 0
fi
# Only swallow the specific "a release already exists for this tag" race (two runs of this
# job triggered for the same tag) — any other failure (auth error, --verify-tag rejection,
# --generate-notes error, etc.) must fail the job, not be silently papered over by falling
# through to `gh release view`. A bare `create || view` cannot tell those apart: when a
# STALE Release from a prior aborted run exists, `view` succeeds and the run goes green,
# and the matrix then signs, attests and uploads onto that stale Release.
if echo "$create_out" | grep -qi "already exists"; then
echo "Release ${GITHUB_REF_NAME} already exists — reusing it (parallel/retried run)."
gh release view "${GITHUB_REF_NAME}" --repo "${GITHUB_REPOSITORY}"
else
exit "$status"
fi

# One signed .tar.gz per target: {cdylib + manifest.json}, packed by busbar-plugin-pack and
# signed with the busbar release PRIVATE key (BUSBAR_SIGN_KEY secret) so it verifies as
Expand Down