File tree Expand file tree Collapse file tree 1 file changed +39
-0
lines changed
Expand file tree Collapse file tree 1 file changed +39
-0
lines changed Original file line number Diff line number Diff line change 1+ on :
2+ push :
3+ branches :
4+ - v3-cli-test-workflow
5+ jobs :
6+ cli-tag-version :
7+ runs-on : ubuntu-24.04
8+ steps :
9+ - uses : actions/checkout@v5
10+ name : Checkout code
11+ with :
12+ fetch-depth : 0
13+ - name : Get version from cli's build.gradle
14+ id : get_version
15+ run : |
16+ version=$(grep "^version" here-naksha-cli/build.gradle.kts | tail -1 | cut -d = -f 2 | xargs)
17+ echo "Detected version: $version"
18+ echo "version=$version" >> "$GITHUB_OUTPUT"
19+ - name : Check if tag exists
20+ id : check_tag
21+ run : |
22+ tag="test-cli-v${{ steps.get_version.outputs.version }}"
23+ echo "tag=$tag" >> "$GITHUB_OUTPUT"
24+ echo "Checking for tag: $tag"
25+ if git rev-parse "$tag" >/dev/null 2>&1; then
26+ echo "Tag already exists"
27+ echo "exists=true" >> "$GITHUB_OUTPUT"
28+ else
29+ echo "Tag does not exist"
30+ echo "exists=false" >> "$GITHUB_OUTPUT"
31+ fi
32+ - name : Create Git tag
33+ if : steps.check_tag.outputs.exists == 'false'
34+ run : |
35+ tag=${{ steps.check_tag.outputs.tag }}
36+ git config user.name "github-actions[bot]"
37+ git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
38+ git tag "$tag"
39+ git push --tags origin "$tag"
You can’t perform that action at this time.
0 commit comments