ci: publish v1 and v1.1 tags

This is standard for actions. Generates vX and vX.Y for new tag vX.Y.Z
This commit is contained in:
Michal Dvořák 2022-06-22 16:17:05 +02:00 committed by GitHub
parent bdba66714e
commit f588b8033b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

32
.github/workflows/update-tags.yml vendored Normal file
View file

@ -0,0 +1,32 @@
name: Update Tags
on:
push:
tags:
- v*.*.*
jobs:
generate:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Parse semver
uses: madhead/semver-utils@v2
id: version
with:
version: ${{ github.ref_name }}
- name: Update tags
run: |
TAGS='v${{ steps.version.outputs.major }} v${{ steps.version.outputs.major }}.${{ steps.version.outputs.minor }}'
for t in $TAGS; do
git tag -f "$t"
git push origin ":$t" 2>/dev/null || true
git push origin "$t"
done