-
-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CI: release drafter GitHub Action (#519)
- Loading branch information
Showing
4 changed files
with
65 additions
and
2,240 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
# Requires repo secret: PERSONAL_ACCESS_TOKEN with permissions: | ||
# Contents: read and write | ||
# Pull Requests: read | ||
|
||
name: Release Drafter | ||
|
||
on: | ||
push: | ||
branches: | ||
- 'main' | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
# Check to see if the package.json version has changed | ||
- id: check | ||
uses: EndBug/version-check@v2 | ||
with: | ||
diff-search: true | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
# Generate the release's markdown template | ||
- if: steps.check.outputs.changed == 'true' | ||
id: auto-changelog | ||
run: | | ||
EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64) | ||
echo "MARKDOWN<<$EOF" >> "$GITHUB_OUTPUT" | ||
./scripts/auto-changelog.sh >> "$GITHUB_OUTPUT" | ||
echo "" >> "$GITHUB_OUTPUT" | ||
echo "" >> "$GITHUB_OUTPUT" | ||
echo "$EOF" >> "$GITHUB_OUTPUT" | ||
# Create/update the draft release | ||
- if: steps.check.outputs.changed == 'true' | ||
id: release-drafter | ||
uses: release-drafter/release-drafter@v5 | ||
with: | ||
name: v${{ steps.check.outputs.version }} | ||
tag: v${{ steps.check.outputs.version }} | ||
version: ${{ steps.check.outputs.version }} | ||
commitish: ${{ github.sha }} | ||
# NOTE(cemmer): `template` can't be supplied here, only `header` and `footer`, so have to pick one of those | ||
# and make sure the .github/release-drafter.yml's `template` is empty-ish. | ||
header: ${{ steps.auto-changelog.outputs.MARKDOWN }} | ||
env: | ||
# NOTE(cemmer): PAT here causes the release to be made under your account. | ||
# ${{ secrets.GITHUB_TOKEN }} would cause it to be created from `github-actions`, even when published. | ||
GITHUB_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }} | ||
- if: ${{ steps.create-pull-request.outputs.pull-request-number }} | ||
run: | | ||
echo "# v${{ steps.release-drafter.outputs.id }}" >> "$GITHUB_STEP_SUMMARY" | ||
echo "" >> "$GITHUB_STEP_SUMMARY" | ||
echo "${{ steps.release-drafter.outputs.html_url }}" >> "$GITHUB_STEP_SUMMARY" |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.