I tag come marcatori di release
Un tag Git e un'etichetta immutabile su un commit. I tag annotati portano nome del tagger, data e messaggio.
Creare tag
# Annotated
git tag -a v1.4.0 -m "Release 1.4.0"
# Signed
git tag -s v1.4.0 -m "Release 1.4.0"
# Lightweight
git tag v1.4.0-alpha
Pushare i tag
git push origin v1.4.0
git push --tags
git push --follow-tags
Triggerare CI sui tag
on:
push:
tags:
- 'v*.*.*'
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: npm ci
- run: npm run build
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
SemVer e prerelease
if [[ "$TAG" =~ -(alpha|beta|rc) ]]; then
npm publish --tag next
else
npm publish
fi
Generare changelog dai tag
git log v1.3.0..v1.4.0 --oneline --no-merges
npx conventional-changelog -p angular -i CHANGELOG.md -s
Elencare e ispezionare tag
git tag
git tag -l 'v1.*'
git show v1.4.0
git tag --contains <sha>
git describe --tags HEAD
Eliminare e spostare tag
git tag -d v1.4.0
git push origin --delete v1.4.0
git tag -a v1.4.0 -m "Release 1.4.0" <new-sha>
git push origin v1.4.0