diff --git a/.github/workflows/update-major-tag.yml b/.github/workflows/update-major-tag.yml new file mode 100644 index 0000000..ee73f7d --- /dev/null +++ b/.github/workflows/update-major-tag.yml @@ -0,0 +1,23 @@ +name: Update major version tag + +on: + release: + types: [published] + +jobs: + update-tag: + runs-on: ubuntu-latest + permissions: + contents: write + + steps: + - uses: actions/checkout@v6 + with: + fetch-depth: 0 + - name: Update major version tag + run: | + VERSION="${{ github.event.release.tag_name }}" + MAJOR="v$(echo "$VERSION" | sed 's/^v//' | cut -d. -f1)" + echo "Updating $MAJOR tag to point to $VERSION" + git tag -f "$MAJOR" "$VERSION" + git push -f origin "$MAJOR"