55 release_version :
66 description : ' Version number of the release'
77 required : true
8+ env :
9+ RELEASE_VERSION : ${{ github.event.inputs.release_version }}
10+ permissions : {}
811jobs :
912 build-and-release :
13+ permissions :
14+ contents : write
15+ actions : read
16+ issues : write
17+ pull-requests : write
1018 runs-on : ubuntu-latest
1119 name : " Build and release"
1220
1321 steps :
1422 - name : Checkout
15- uses : actions/checkout@v4
23+ uses : actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
1624
1725 - name : Set up JDK 17
18- uses : actions/setup-java@v4
26+ uses : actions/setup-java@f2beeb24e141e01a676f977032f5a29d81c9e27e # v5.1.0
1927 with :
2028 distribution : ' temurin'
2129 java-version : ' 17'
2937 - name : Build artifact and release to Maven Central
3038 run : |
3139 set -x
32- ./mvnw -B versions:set -DnewVersion=${{ github.event.inputs.release_version } }
40+ ./mvnw -B versions:set -DnewVersion=${RELEASE_VERSION }
3341 ./mvnw -B versions:commit
3442 ./mvnw -B -U clean deploy -Psign,release-build
3543 env :
@@ -42,20 +50,20 @@ jobs:
4250 # - Create Github release
4351
4452 - name : Commit version changes and push to upstream repository
45- uses : stefanzweifel/git-auto-commit-action@v4
53+ uses : stefanzweifel/git-auto-commit-action@04702edda442b2e678b25b537cec683a1493fcb9 # v7.1.0
4654 with :
4755 branch : main
4856 commit_user_name : github-actions
4957 commit_user_email : github-actions@github.com
5058 commit_author : Actions <actions@github.com>
51- commit_message : " Set to version ${{ github.event.inputs.release_version }}"
59+ commit_message : " Set to version ${{ env.RELEASE_VERSION }}"
5260 file_pattern : ' pom.xml'
5361
5462 - name : Create GitHub release
55- uses : softprops/action-gh-release@v1
63+ uses : softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844 # v0.1.15
5664 with :
5765 body : " Create Github release"
58- tag_name : v${{ github.event.inputs.release_version }}
66+ tag_name : v${{ env.RELEASE_VERSION }}
5967 target_commitish : main
6068 draft : false
6169 prerelease : false
6977 ./mvnw -B versions:commit
7078
7179 - name : Commit version changes and push to upstream repository
72- uses : stefanzweifel/git-auto-commit-action@v4
80+ uses : stefanzweifel/git-auto-commit-action@04702edda442b2e678b25b537cec683a1493fcb9 # v7.1.0
7381 with :
7482 branch : main
7583 commit_user_name : github-actions
0 commit comments