Skip to content

v0.0.1

v0.0.1 #1

Workflow file for this run

name: Release
on:
release:
types: [published]
jobs:
tag-major:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Move major version tag
if: ${{ !github.event.release.prerelease }}
env:
GH_TOKEN: ${{ github.token }}
run: |
VERSION="${{ github.event.release.tag_name }}"
# Only move the major tag if this is the latest release for the repo
LATEST=$(gh release view --repo "${{ github.repository }}" --json tagName -q .tagName)
if [ "$LATEST" != "$VERSION" ]; then
echo "Skipping: $VERSION is not the latest release (latest is $LATEST)"
exit 0
fi
MAJOR="v$(echo "$VERSION" | sed 's/^v//' | cut -d. -f1)"
git tag -f "$MAJOR"
git push origin "refs/tags/$MAJOR" --force