A GitHub Action to automatically bump and tag master, on merge, with the latest SemVer formatted version. Works on any platform.
name: Bump version
on:
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Bump version and push tag
id: tag_version
uses: mathieudutour/github-tag-action@v6.2
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Create a GitHub release
uses: ncipollo/release-action@v1
with:
tag: ${{ steps.tag_version.outputs.new_tag }}
name: Release ${{ steps.tag_version.outputs.new_tag }}
body: ${{ steps.tag_version.outputs.changelog }}
${{ secrets.GITHUB_TOKEN }}
.false
).master
or .*
or release.*,hotfix.*,master
... (default: master,main
).patch
). You can also set false
to avoid generating a new tag when none is explicitly provided. Can be patch, minor or major
.prerelease
). You can also set false
to avoid generating a new tag when none is explicitly provided. Can be prerelease, prepatch, preminor or premajor
.false
).v
).<branch>
).custom_release_rules (optional) - Comma separated list of release rules.
Format: <keyword>:<release_type>:<changelog_section>
where <changelog_section>
is optional and will default to Angular's conventions.
Examples:
hotfix:patch,pre-feat:preminor
,bug:patch:Bug Fixes,chore:patch:Chores
undefined
.undefined
.v0.0.0
if none). Note that if custom_tag
is set, this will be undefined
.0.0.0
if none) without the prefix. Note that if custom_tag
is set, this will be undefined
.major
, minor
, patch
or custom
- can be prefixed with pre
).Note: This action creates a lightweight tag by default.
The action will parse the new commits since the last tag using the semantic-release conventions.
semantic-release uses the commit messages to determine the type of changes in the codebase. Following formalized conventions for commit messages, semantic-release automatically determines the next semantic version number.
By default semantic-release uses Angular Commit Message Conventions.
Here is an example of the release type that will be done based on a commit messages:
Commit message | Release type |
``` fix(pencil): stop graphite breaking when too much pressure applied ``` | Patch Release |
``` feat(pencil): add 'graphiteWidth' option ``` | Minor Release |
``` perf(pencil): remove graphiteWidth option BREAKING CHANGE: The graphiteWidth option has been removed. The default graphite width of 10mm is always used for performance reasons. ``` | Major Release |
If no commit message contains any information, then default_bump will be used.
anothrNick/github-tag-action - a similar action using a Dockerfile (hence not working on macOS)