This GitHub Action simplifies the process of updating major/minor release tags on a tag push. For example, it automatically updates both v1
and v1.2
tags when releasing version v1.2.3
. Additionally, it provides the option to move the patch version up to the latest commit, making it convenient for use with tools like auto-changelog to automatically generate changelogs for your releases.
It's designed to seamlessly integrate with GitHub Actions. For more details on versioning your action, refer to GitHub Actions documentation.
Optional. Specifies the existing tag to update from. Defaults to $GITHUB_REF
.
Optional. Custom tag message. Default: Release $TAG
.
Optional. Creates only major version tags. Default: false
.
Optional. Moves the existing tag to the latest commit inside the GitHub Action. Default: false
. Note that this only works when you explicitly specify a tag to prevent unexpected changes.
Optional. Only required for checkout@v1 action; otherwise, it's not necessary if you use checkout@v2 or higher.
Optional. Specifies the GPG private key to sign the tag with. Default: ""
.
Optional. Specifies the GPG passphrase to sign the tag with. Default: ""
.
name: Update Semver
on:
push:
branches-ignore:
- "**"
tags:
- "v*.*.*"
jobs:
update-semver:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: rickstaa/action-update-semver@v1
with:
major_version_tag_only: true # (optional, default is "false")
Certainly! Here's a refined version of your documentation:
To sign tags with GPG, follow these steps:
First, generate a GPG key. Once generated, export the GPG private key in ASCII armored format to your clipboard using one of the following commands based on your operating system:
-
macOS:
gpg --armor --export-secret-key joe@foo.bar | pbcopy
-
Ubuntu (GNU base64):
gpg --armor --export-secret-key joe@foo.bar -w0 | xclip -selection clipboard
-
Arch:
gpg --armor --export-secret-key joe@foo.bar | xclip -selection clipboard -i
-
FreeBSD (BSD base64):
gpg --armor --export-s[.github/workflows/update_semver.yml](.github/workflows/update_semver.yml)e your GPG passphrase.
Modify your workflow YAML file to include the GPG private key and passphrase in the gpg_private_key
and gpg_passphrase
inputs:
name: Update Semver
on:
push:
branches-ignore:
- "**"
tags:
- "v*.*.*"
jobs:
update-semver:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: rickstaa/action-update-semver@v1
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
gpg_passphrase: ${{ secrets.PASSPHRASE }}
major_version_tag_only: true # (optional, default is "false")
This workflow will now sign tags using the specified GPG key during tag creation.
Feel free to open an issue if you have ideas on how to improve this GitHub Action or if you want to report a bug! All contributions are welcome. 🚀 Please consult the contribution guidelines for more information.
This action is based on @haya14busa's update-major-minor-semver.