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
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Release
name: Deploy Release

on:
push:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Tag
name: Release

on:
workflow_dispatch:
Expand Down Expand Up @@ -45,12 +45,23 @@ jobs:
exit 1
fi

- name: Create and push annotated tag
- name: Create GitHub release and tag
# Creating the release with a PAT (not the default GITHUB_TOKEN) makes
# gh create the tag, which produces a tag-push event that triggers the
# Deploy Release workflow. Tags created with GITHUB_TOKEN do not trigger
# other workflows.
env:
GH_TOKEN: ${{ secrets.GH_PAT }}
run: |
TAG="${{ steps.ver.outputs.tag }}"
SHA="$(git rev-parse HEAD)"
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git tag -a "$TAG" -m "$TAG" "$SHA"
git push origin "$TAG"
echo "Tagged $SHA as $TAG. Release workflow will run on the tag push." >> "$GITHUB_STEP_SUMMARY"
PRERELEASE_FLAG=""
if [[ "$TAG" =~ -([Rr][Cc]|beta|alpha) ]]; then
PRERELEASE_FLAG="--prerelease"
fi
gh release create "$TAG" \
--title "$TAG" \
--target "$SHA" \
--generate-notes \
$PRERELEASE_FLAG

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does this do?

echo "Created release $TAG at $SHA. Deploy Release workflow will run on the tag push." >> "$GITHUB_STEP_SUMMARY"
Loading