File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : Auto Tag on Version Change
2+
3+ on :
4+ push :
5+ branches :
6+ - main
7+ paths :
8+ - ' jup-ag-sdk/Cargo.toml'
9+
10+ # Add permissions section
11+ permissions :
12+ contents : write
13+
14+ jobs :
15+ auto-tag :
16+ runs-on : ubuntu-latest
17+ steps :
18+ - uses : actions/checkout@v3
19+ with :
20+ fetch-depth : 0
21+ token : ${{ secrets.GITHUB_TOKEN }} # Use the default token with write permissions
22+
23+ - name : Get version from Cargo.toml
24+ id : get_version
25+ run : |
26+ VERSION=$(grep -m 1 "version" jup-ag-sdk/Cargo.toml | sed 's/.*= "//' | sed 's/".*//')
27+ echo "version=$VERSION" >> $GITHUB_OUTPUT
28+ echo "Found version: $VERSION"
29+
30+ - name : Check if tag exists
31+ id : check_tag
32+ run : |
33+ if git tag -l "v${{ steps.get_version.outputs.version }}" | grep -q "v${{ steps.get_version.outputs.version }}"; then
34+ echo "Tag already exists"
35+ echo "exists=true" >> $GITHUB_OUTPUT
36+ else
37+ echo "Tag does not exist"
38+ echo "exists=false" >> $GITHUB_OUTPUT
39+ fi
40+
41+ - name : Create and push tag
42+ if : steps.check_tag.outputs.exists == 'false'
43+ run : |
44+ git config --local user.email "github-actions[bot]@users.noreply.github.com"
45+ git config --local user.name "github-actions[bot]"
46+ git tag -a v${{ steps.get_version.outputs.version }} -m "Release version ${{ steps.get_version.outputs.version }}"
47+ git push origin v${{ steps.get_version.outputs.version }}
48+ echo "Created and pushed tag v${{ steps.get_version.outputs.version }}"
Original file line number Diff line number Diff line change 11[package ]
22name = " jup-ag-sdk"
3- version = " 1.0.1 "
3+ version = " 1.0.2 "
44edition = " 2024"
55license-file = " ../LICENSE"
66readme = " ../README.md"
You can’t perform that action at this time.
0 commit comments