File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Load Diff This file was deleted.
Original file line number Diff line number Diff line change 11name : release
22
3- on :
3+ on :
4+ workflow_dispatch :
45 push :
5- tags :
6- - " v* "
6+ branches :
7+ - main
78
89jobs :
910 release :
1415
1516 - name : Checkout
1617 uses : actions/checkout@v4
18+
19+ - name : Check version
20+ id : version-check
21+ run : |
22+ chmod +x ./scripts/is-newer-version.bash
23+ chmod +x ./scripts/get-version.bash
24+ VERSION=$(./scripts/is-newer-version.bash)
25+ echo "version=${VERSION}" >> $GITHUB_OUTPUT
26+ if [ "$VERSION" != "0" ]; then
27+ echo "New version detected: $VERSION"
28+ else
29+ echo "No new version to release"
30+ fi
31+
32+ - name : Push tag
33+ if : steps.version-check.outputs.version != '0'
34+ run : |
35+ tag="v${{ steps.version-check.outputs.version }}"
36+ git config user.name "${GITHUB_ACTOR}"
37+ git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
38+ git tag -a "${tag}" -m "Release ${tag}"
39+ git push origin "${tag}"
1740
1841 - name : Create release
42+ if : steps.version-check.outputs.version != '0'
1943 uses : ncipollo/release-action@v1
2044 with :
2145 token : ${{ secrets.TOKEN }}
You can’t perform that action at this time.
0 commit comments