Skip to content
Merged
Show file tree
Hide file tree
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
30 changes: 30 additions & 0 deletions .github/workflows/major-version-tag.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Major version tag

on:
release:
types: [published]

permissions:
contents: write

jobs:
retag:
if: "!github.event.release.prerelease"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0

- name: Move major version tag
env:
TAG: ${{ github.event.release.tag_name }}
run: |
if [[ ! "$TAG" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "Skipping: $TAG is not a vMAJOR.MINOR.PATCH tag"
exit 0
fi

major="${TAG%%.*}"
git tag -f "$major" "$TAG"
git push --force origin "$major"
7 changes: 2 additions & 5 deletions RELEASING.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,9 @@

This action follows [Semantic Versioning]. The major version tag (e.g. `v1`) is kept pointing at the latest patch release in that series so consumers who pin `thoughtbot/importmap-update@v1` get updates automatically.

After tagging `v1.x.x`, move the floating tag:
The [Major version tag workflow](.github/workflows/major-version-tag.yml) moves it automatically when a non-prerelease release is published, so step 5 above is the last manual step.

```
git tag -f v1
git push --force origin v1
```
Do not create a GitHub release for the `v1` tag. Releases in this repo are immutable, and attaching one would freeze the tag in place.

[Semantic Versioning]: https://semver.org

Expand Down