Skip to content
This repository has been archived by the owner on Jan 5, 2024. It is now read-only.

Commit

Permalink
Add a new workflow to generate release on tag push (#164)
Browse files Browse the repository at this point in the history
Add a new workflow to generate release on tag push

This way, when running `git push --tags`, after appropriately tagging a commit
as `vx.y.z`, a GitHub release page will be created titled `vx.y.z` (that is,
the name of the tag) and with two pieces of contents:

- the title and body of the tagged commit. This assumes that the commit message
  is properly sanitized, so its inclusion in the release page is worthwhile
  and/or informative
- the changelog since the last tag, assuming semver

GitHub gives a higher priority to releases than to tags. Releases show up on
the side of the repository, can have special triggers for workflows, can be
subscribed to (so that downstream users will know to update). The last item is
especially relevant since dependency update bots (e.g., Dependabot) can be
configured to look for releases of GitHub actions used in the workflows of a
repository and update them when these change. This is especially useful if
the upstream actions are pinned by hash instead of by short tag name (as
recommended by supply-chain security best guidelines -- not implemented here,
as the goal is to follow the setup of the other actions).

Prompted by discussion on #148, after
closing.

Signed-off-by: Mihai Maruseac <[email protected]>
  • Loading branch information
mihaimaruseac authored Jan 9, 2023
1 parent 303607c commit 545f4c5
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: "/release"
on:
push:
tags:
- v*.*.*

jobs:
release:
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/') # only run on "releases" (pushes to tags)
steps:
- uses: actions/checkout@v3
- run: git show HEAD --format='%s%n%n%b' -s > .release_body
- uses: softprops/action-gh-release@v1
with:
generate_release_notes: true
body_path: .release_body

0 comments on commit 545f4c5

Please sign in to comment.