1- name : Release
1+ name : Auto Release
22
33on :
44 push :
@@ -12,58 +12,21 @@ jobs:
1212 release :
1313 runs-on : ubuntu-latest
1414 steps :
15- - name : Checkout
15+ - name : Checkout repository
1616 uses : actions/checkout@v4
1717 with :
1818 fetch-depth : 0
1919
20- - name : Install svu
21- run : |
22- curl -sL https://github.com/caarlos0/svu/releases/download/v2.3.0/svu_2.3.0_linux_amd64.tar.gz | tar xvz
23- sudo mv svu /usr/local/bin/
24-
25- - name : Get current version
26- id : current
27- run : |
28- CURRENT=$(svu current 2>/dev/null || echo "v0.0.0")
29- echo "version=$CURRENT" >> $GITHUB_OUTPUT
30-
31- - name : Calculate next patch version
32- id : next
33- run : |
34- NEXT=$(svu patch)
35- echo "version=$NEXT" >> $GITHUB_OUTPUT
36-
37- - name : Check if version changed
38- id : check
39- run : |
40- if [ "${{ steps.current.outputs.version }}" == "${{ steps.next.outputs.version }}" ]; then
41- echo "changed=false" >> $GITHUB_OUTPUT
42- echo "No new commits since last release"
43- else
44- echo "changed=true" >> $GITHUB_OUTPUT
45- echo "New version: ${{ steps.next.outputs.version }}"
46- fi
47-
48- - name : Create and push tag
49- if : steps.check.outputs.changed == 'true'
50- run : |
51- git config user.name "github-actions[bot]"
52- git config user.email "github-actions[bot]@users.noreply.github.com"
53- git tag ${{ steps.next.outputs.version }}
54- git push origin ${{ steps.next.outputs.version }}
20+ - name : Calculate next version
21+ id : version
22+ uses : charlesthomas/github-action-svu@v1.1.4+3.2.3
23+ with :
24+ cmd : patch
25+ pushTag : true
5526
5627 - name : Create GitHub Release
57- if : steps.check.outputs.changed == 'true'
58- uses : actions/create-release@v1
59- env :
60- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
28+ if : steps.version.outputs.changed == 'true'
29+ uses : softprops/action-gh-release@v2
6130 with :
62- tag_name : ${{ steps.next.outputs.version }}
63- release_name : ${{ steps.next.outputs.version }}
64- draft : false
65- prerelease : false
66- body : |
67- Automated patch release ${{ steps.next.outputs.version }}
68-
69- See [CHANGELOG](https://github.com/${{ github.repository }}/compare/${{ steps.current.outputs.version }}...${{ steps.next.outputs.version }}) for details.
31+ tag_name : ${{ steps.version.outputs.next }}
32+ generate_release_notes : true
0 commit comments