Skip to content
Merged
Show file tree
Hide file tree
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
16 changes: 16 additions & 0 deletions .github/workflows/release-tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,13 @@ on:
description: Create the GitHub release of the tag (generated notes) after the tag.
type: boolean
default: false
release-notes:
description: >-
With github-release: the Markdown file that is the release's text, `{version}` standing for
the version without the tag prefix (e.g. release-notes/{version}.md); the file must exist.
Empty = notes generated from the merged pull requests.
type: string
default: ""
harness-ref:
description: Ref of IronFlock/workflows the harness scripts are taken from.
type: string
Expand Down Expand Up @@ -135,9 +142,18 @@ jobs:
GH_TOKEN: ${{ steps.app.outputs.token }}
REPO: ${{ github.repository }}
TAG: ${{ steps.version.outputs.tag }}
TAG_PREFIX: ${{ inputs.tag-prefix }}
NOTES: ${{ inputs.release-notes }}
run: |
if gh release view "$TAG" --repo "$REPO" >/dev/null 2>&1; then
echo "the GitHub release $TAG exists"
elif [ -n "$NOTES" ]; then
notes=${NOTES//"{version}"/${TAG#"$TAG_PREFIX"}}
if [ ! -f "$notes" ]; then
echo "::error::$TAG has no release notes: $notes is missing"
exit 1
fi
gh release create "$TAG" --repo "$REPO" --verify-tag --title "$TAG" --notes-file "$notes"
else
gh release create "$TAG" --repo "$REPO" --verify-tag --title "$TAG" --generate-notes
fi
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,10 @@ released commit (never a force push), for a hosting service that deploys from
a branch: only release merges reach it. Protect that branch with a ruleset
whose only bypass actor is the release App.
With `github-release: true` it also creates the GitHub release of the tag
(generated notes), with the same token, so callers need no write rights. Both
(generated notes), with the same token, so callers need no write rights.
`release-notes` names a Markdown file in the repository to use as the
release's text instead (`{version}` stands for the version, e.g.
`release-notes/{version}.md`); the step fails when that file is missing. Both
steps catch up on a re-run that finds the tag already set.

## Pull requests from a laptop
Expand Down
Loading