From f588b8033bfe2c60d66688b073f78b96fa361a47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20Dvo=C5=99=C3=A1k?= <484607+mdvorak@users.noreply.github.com> Date: Wed, 22 Jun 2022 16:17:05 +0200 Subject: [PATCH] ci: publish v1 and v1.1 tags This is standard for actions. Generates vX and vX.Y for new tag vX.Y.Z --- .github/workflows/update-tags.yml | 32 +++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 .github/workflows/update-tags.yml diff --git a/.github/workflows/update-tags.yml b/.github/workflows/update-tags.yml new file mode 100644 index 0000000..39f1b55 --- /dev/null +++ b/.github/workflows/update-tags.yml @@ -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