-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add workflow for pushing tag when VERSION file changes
Signed-off-by: Yi Chen <[email protected]>
- Loading branch information
Showing
2 changed files
with
45 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,44 @@ | ||
name: Push Tag on VERSION change | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
- release-* | ||
paths: | ||
- VERSION | ||
|
||
jobs: | ||
push_tag: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout source code | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Set up Git | ||
run: | | ||
git config user.name "$GITHUB_ACTOR" | ||
git config user.email "[email protected]" | ||
- name: Read version from VERSION file | ||
run: | | ||
VERSION=$(cat VERSION) | ||
echo "VERSION=$VERSION" >> $GITHUB_ENV | ||
- name: Check if tag exists | ||
run: | | ||
git fetch --tags | ||
if git tag -l | grep -q "^${VERSION}$"; then | ||
echo "TAG_EXISTS=true" >> $GITHUB_ENV | ||
else | ||
echo "TAG_EXISTS=false" >> $GITHUB_ENV | ||
fi | ||
- name: Create and push tag | ||
if: env.TAG_EXISTS == 'false' | ||
run: | | ||
git tag -a "$VERSION" -m "Release $VERSION" | ||
git push origin "$VERSION" |
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 @@ | ||
v1beta2-1.6.2-3.5.0 |