-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a workflow to always point the major version tag to the latest re…
…lease.
- Loading branch information
1 parent
43f11c4
commit 99422ea
Showing
1 changed file
with
26 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |