Automating release notes
At work, we have a setup that builds and deploy our app to production when pushing to the master
branch. We also use git tags so we can have versioned releases.
I wanted to automate this process like so:
- Use a single command that bumps version, adds git tag and creates release commit
- Auto-generate changelog using commits between branch tip and last tag
- Auto-generate release notes in release tab on GitHub (should be same as last changelog entry)
- Post release notes into Slack channel to notify team members about deployment
To achieve this I combined several services.
-
standard-version
to handle the first two requirements. I did it by runningnpx standard-version
. -
GitHub Automatic Releases
action to generate GitHub release notes on tag push. It doesn't useCHANGELOG.md
but looks at the same commit set and extracts it almost identically. I was fine with that.
My .github/workflows/release.yml
file:
name: Release
on:
push:
tags:
- "v*"
jobs:
tagged-release:
name: "Tagged Release"
runs-on: "ubuntu-latest"
steps:
- uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
prerelease: false
- GitHub's Slack app to subscribe to releases in my repo and post them in
#releases
channel.
These are commands I posted in the channel to subscribe only to releases and eliminate other GH chatter:
/github subscribe popularlab/REPO-NAME
/github unsubscribe popularlab/REPO-NAME issues,pulls,statuses,commits,public,deployments