Skip to content
Merged
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
26 changes: 26 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,16 @@ jobs:
git commit -m "chore: bump manifest to ${VERSION} for ${TAG}"
git push -u origin "$BRANCH"

git fetch origin --tags
HEAD_SHA=$(git rev-parse HEAD)
if git show-ref --verify --quiet "refs/tags/${TAG}"; then
TAG_SHA=$(git rev-parse "${TAG}^{}" 2>/dev/null || git rev-parse "refs/tags/${TAG}")
if [ "$TAG_SHA" != "$HEAD_SHA" ]; then
echo "::error::Git tag \`${TAG}\` already exists and points to \`${TAG_SHA}\`, but \`${BRANCH}\` HEAD is \`${HEAD_SHA}\`. On GitHub delete the \`${TAG}\` tag and any release tied to it (Releases → … → Delete), then re-run this workflow, or use a higher version."
exit 1
fi
fi

EXTRA=( )
if [ "$INPUT_DRAFT" = "true" ]; then EXTRA+=(--draft); fi
if [ "$INPUT_PRERELEASE" = "true" ]; then EXTRA+=(--prerelease); fi
Expand All @@ -123,3 +133,19 @@ jobs:
--head "$BRANCH" \
--title "Merge ${TAG} manifest bump" \
--body "Automated manifest bump for [${TAG}](https://github.com/${{ github.repository }}/releases/tag/${TAG}). Merge after checks pass so \`${DEFAULT_BRANCH}\` matches the release."

- name: Summary
if: success()
env:
BRANCH: ${{ needs.normalize.outputs.branch }}
TAG: ${{ needs.normalize.outputs.tag }}
DEFAULT_BRANCH: ${{ github.event.repository.default_branch }}
run: |
{
echo "## Create release"
echo "The manifest bump lives on branch **\`${BRANCH}\`**, not on **\`${DEFAULT_BRANCH}\`** until you **merge the pull request** from this run."
echo ""
echo "If \`${DEFAULT_BRANCH}\` still shows the old version, open **Pull requests** and merge the PR titled **Merge ${TAG} manifest bump**."
echo ""
echo "**Draft releases** use a temporary \`untagged-…\` URL in the job log until you **Publish** the release on GitHub; then the normal \`/releases/tag/${TAG}\` link applies."
} >> "$GITHUB_STEP_SUMMARY"
Loading