From 603858ef4ec1d42b6d2a9cc4ef6ee342da388168 Mon Sep 17 00:00:00 2001 From: Shakar Bakr <5h4k4r.b4kr@gmail.com> Date: Wed, 1 Nov 2023 16:43:57 +0300 Subject: [PATCH] Update main version on every minor releases Signed-off-by: Shakar Bakr <5h4k4r.b4kr@gmail.com> --- .github/workflows/update-main-version.yaml | 32 ++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 .github/workflows/update-main-version.yaml diff --git a/.github/workflows/update-main-version.yaml b/.github/workflows/update-main-version.yaml new file mode 100644 index 0000000..ba7ac27 --- /dev/null +++ b/.github/workflows/update-main-version.yaml @@ -0,0 +1,32 @@ +name: Release +on: + push: + tags: + - v*.*.* + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: version + id: version + run: | + tag=${GITHUB_REF/refs\/tags\//} + version=${tag#v} + major=${version%%.*} + echo "tag=${tag}" >> $GITHUB_OUTPUT + echo "version=${version}" >> $GITHUB_OUTPUT + echo "major=${major}" >> $GITHUB_OUTPUT + + - name: force update major tag + run: | + git config user.name github-actions + git config user.email github-actions@github.com + + git tag v${{ steps.version.outputs.major }} ${{ steps.version.outputs.tag }} -f + git push origin refs/tags/v${{ steps.version.outputs.major }} -f