From c6370c11e292bdf5524cb86f857dea402c3704fd Mon Sep 17 00:00:00 2001 From: Zack Koppert Date: Fri, 16 Jun 2023 15:06:43 -0700 Subject: [PATCH] Create major-version-updater.yml --- .github/workflows/major-version-updater.yml | 28 +++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 .github/workflows/major-version-updater.yml diff --git a/.github/workflows/major-version-updater.yml b/.github/workflows/major-version-updater.yml new file mode 100644 index 0000000..ab3142e --- /dev/null +++ b/.github/workflows/major-version-updater.yml @@ -0,0 +1,28 @@ +--- +name: Major Version Updater +# Whenever a new release is made, push a major version tag +on: + release: + types: [ published ] + +jobs: + update-major-version-tag: + runs-on: ubuntu-latest + steps: + - name: Checkout Repo + uses: actions/checkout@v3 + + - 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 tag v${{ steps.version.outputs.major }} + git push origin refs/tags/v${{ steps.version.outputs.major }} -f