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
19 changes: 19 additions & 0 deletions .github/RELEASE_NOTES_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<!--
Patch record of a release. Pushing a tag vX.Y.Z on a commit of production runs
.github/workflows/release-draft.yml, which runs the tests and creates the release as a
draft with generated notes and this template, with vX.Y.Z replaced by the tag.

To create the draft by hand instead:

gh release create vX.Y.Z --draft --generate-notes --notes-file .github/RELEASE_NOTES_TEMPLATE.md

Fill in the fields below, then publish the release. Add the deploy date once the
release is running in production.
-->

## Patch record

- Release tag: vX.Y.Z
- Deployed to production: YYYY-MM-DD
- Components updated: list them here. A grouped Dependabot pull request shows only its group name under "Dependency updates", so copy the packages from its description.
- CVEs and advisories addressed: none
11 changes: 11 additions & 0 deletions .github/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Categories for automatically generated release notes.
# Dependabot labels its pull requests "dependencies", so the components that a
# release updates are listed on their own for the patch record.
changelog:
categories:
- title: Dependency updates
labels:
- dependencies
- title: Other changes
labels:
- "*"
5 changes: 5 additions & 0 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ name: Run Unit Tests On Push

on:
push:
# Branches only. A release tag runs these tests inside release-draft.yml,
# so they do not run twice for the same tag.
branches:
- "**"
workflow_call:

jobs:
unit-tests:
Expand Down
49 changes: 49 additions & 0 deletions .github/workflows/release-draft.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Draft release

on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+"

permissions:
contents: read

jobs:
on-production:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Tagged commit must be on production
run: |
git fetch --no-tags origin production
if ! git merge-base --is-ancestor "$GITHUB_SHA" origin/production; then
echo "::error::tag $GITHUB_REF_NAME points to a commit that is not on production"
exit 1
fi

test:
needs: on-production
uses: ./.github/workflows/push.yml
secrets: inherit

draft:
needs: test
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Check out code
uses: actions/checkout@v4

- name: Create draft release
env:
GH_TOKEN: ${{ github.token }}
run: |
sed "s/vX\.Y\.Z/${GITHUB_REF_NAME}/g" .github/RELEASE_NOTES_TEMPLATE.md > "$RUNNER_TEMP/notes.md"
gh release create "$GITHUB_REF_NAME" \
--verify-tag --draft --generate-notes \
--notes-file "$RUNNER_TEMP/notes.md"
Loading