release #39
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
name: release | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '0 13 * * 4' # At 01:00 PM, only on Thur | |
permissions: | |
contents: read | |
jobs: | |
draft: | |
permissions: | |
contents: write | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 # Need full history. | |
- uses: actions/setup-go@v5 | |
with: | |
go-version: '1.23.x' | |
cache-dependency-path: tools/go.sum | |
- name: release notes | |
id: release-notes | |
continue-on-error: true | |
run: | | |
go install -C tools ./cmd/release-notes | |
last_release="$(release-notes last-release)" | |
go run github.com/hashicorp/go-changelog/cmd/changelog-build@4d68c58 \ | |
-changelog-template .github/release/changelog.gotmpl \ | |
-note-template .github/release/release-note.gotmpl \ | |
-entries-dir ./.changelog \ | |
-last-release "${last_release}" \ | |
-this-release HEAD | tee /tmp/release-notes.txt | |
echo >> /tmp/release-notes.txt | |
release-notes -last-release "${last_release}" >> /tmp/release-notes.txt | |
- name: draft GH release | |
if: ${{ steps.release-notes.outcome == 'success' }} | |
env: | |
GH_TOKEN: ${{ github.token }} | |
run: | | |
cat /tmp/release-notes.txt | |
tag="$(date '+v%Y.%m.%d')" | |
gh release create "${tag}" \ | |
--notes-file /tmp/release-notes.txt \ | |
--title "${tag}" |