Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: enable shorthand vX tags inherited from latest version #6

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
33 changes: 33 additions & 0 deletions .github/workflows/release-tag.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Release and Tag Management

on:
release:
types: [published]

jobs:
update-major-version-tag:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}

- name: Get major version
id: get_version
run: |
VERSION=${GITHUB_REF#refs/tags/v}
MAJOR_VERSION=v${VERSION%%.*}
echo "major_version=${MAJOR_VERSION}" >> $GITHUB_OUTPUT
echo "full_version=v${VERSION}" >> $GITHUB_OUTPUT

- name: Update major version tag
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git tag -fa ${{ steps.get_version.outputs.major_version }} -m "Update major version tag to ${{ steps.get_version.outputs.full_version }}"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've never made an annotated tag (-a) but -f looks like the way to push that semver major tag up along the releases to the current code, so +1


       -a, --annotate
           Make an unsigned, annotated tag object

       -s, --sign
           Make a GPG-signed tag, using the default e-mail address’s key. The
           default behavior of tag GPG-signing is controlled by tag.gpgSign
           configuration variable if it exists, or disabled otherwise. See
           git-config(1).

       --no-sign
           Override tag.gpgSign configuration variable that is set to force
           each and every tag to be signed.

       -u <key-id>, --local-user=<key-id>
           Make a GPG-signed tag, using the given key.

       -f, --force
           Replace an existing tag with the given name (instead of failing)

git push origin ${{ steps.get_version.outputs.major_version }} --force
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Loading