From 99422ea25ad23c6729e9ffb589cba235cdce7f33 Mon Sep 17 00:00:00 2001 From: James Kessler Date: Wed, 16 Oct 2024 13:23:16 -0700 Subject: [PATCH 1/2] Add a workflow to always point the major version tag to the latest release. --- .../workflows/update-major-version-tag.yml | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 .github/workflows/update-major-version-tag.yml diff --git a/.github/workflows/update-major-version-tag.yml b/.github/workflows/update-major-version-tag.yml new file mode 100644 index 00000000..82af09d1 --- /dev/null +++ b/.github/workflows/update-major-version-tag.yml @@ -0,0 +1,26 @@ +name: Update Major Version Tag + +on: + release: + types: [published] + +jobs: + update-major-version-tag: + runs-on: ubuntu-latest + steps: + - name: Checkout Repository + uses: actions/checkout@v2 + + - name: Extract Major Version + id: extract_major_version + run: | + # Extract the major version part (e.g., "v2" from "v2.3.1") + echo "release_tag=${{ github.event.release.tag_name }}" >> $GITHUB_ENV + major_version=$(echo "${{ github.event.release.tag_name }}" | grep -oE "^v[0-9]+") + echo "major_version=$major_version" >> $GITHUB_ENV + + - name: Update Major Version Tag + run: | + git fetch --tags + git tag -f ${{ env.major_version }} ${{ github.event.release.tag_name }} + git push origin ${{ env.major_version }} --force From 2d07fb5dc1f030529476dca5bcfe662587f2f9c4 Mon Sep 17 00:00:00 2001 From: James Kessler Date: Wed, 16 Oct 2024 13:34:05 -0700 Subject: [PATCH 2/2] Update action version to latest. --- .github/workflows/update-major-version-tag.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/update-major-version-tag.yml b/.github/workflows/update-major-version-tag.yml index 82af09d1..0d9ca810 100644 --- a/.github/workflows/update-major-version-tag.yml +++ b/.github/workflows/update-major-version-tag.yml @@ -9,7 +9,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout Repository - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Extract Major Version id: extract_major_version