1+ name : release
2+ on :
3+ workflow_dispatch :
4+ inputs :
5+ branch :
6+ description : ' Branch to release'
7+ required : true
8+ version :
9+ description : ' Release version'
10+ required : true
11+ nextVersion :
12+ description : ' Next version after release (-SNAPSHOT will be added automatically)'
13+ required : true
14+ jobs :
15+ release :
16+ name : Release
17+ runs-on : ubuntu-latest
18+ permissions :
19+ issues : write
20+ contents : write
21+ deployments : write
22+ id-token : write
23+ steps :
24+ - name : Checkout Code
25+ uses : actions/checkout@v4
26+ with :
27+ ssh-key : ${{ secrets.RELEASE_DEPLOY_KEY }}
28+ fetch-depth : 0
29+ ref : ${{ github.event.inputs.branch }}
30+
31+ - name : Set up JDK 17 for x64
32+ uses : actions/setup-java@v4
33+ with :
34+ java-version : ' 17'
35+ distribution : ' temurin'
36+ architecture : x64
37+ cache : maven
38+
39+ - name : Set release version
40+ run : mvn -B -q versions:set -DnewVersion=${{ github.event.inputs.version }}
41+
42+ - name : Commit, push and tag changes
43+ run : |
44+ git config user.name "microcks-bot"
45+ git config user.email "info@microcks.io"
46+ git commit -m "Releasing version ${{ github.event.inputs.version }}" .
47+ git tag ${{ github.event.inputs.version }}
48+ git push origin ${{ github.event.inputs.version }}
49+
50+ - name : Stage release artifacts
51+ run : mvn -B -Prelease clean deploy -DaltDeploymentRepository=local::default::file://`pwd`/target/staging-deploy
52+
53+ - name : Publish package with JReleaser
54+ env :
55+ JRELEASER_NEXUS2_USERNAME : ${{ secrets.JRELEASER_NEXUS2_USERNAME }}
56+ JRELEASER_NEXUS2_PASSWORD : ${{ secrets.JRELEASER_NEXUS2_PASSWORD }}
57+ JRELEASER_GPG_PASSPHRASE : ${{ secrets.JRELEASER_GPG_PASSPHRASE }}
58+ JRELEASER_GPG_SECRET_KEY : ${{ secrets.JRELEASER_GPG_SECRET_KEY }}
59+ JRELEASER_GPG_PUBLIC_KEY : ${{ secrets.JRELEASER_GPG_PUBLIC_KEY }}
60+ JRELEASER_GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
61+ run : mvn -N -Prelease jreleaser:assemble jreleaser:full-release
62+
63+ # Persist logs
64+ - name : JReleaser release output
65+ if : always()
66+ uses : actions/upload-artifact@v4
67+ with :
68+ name : jreleaser-release
69+ path : |
70+ target/jreleaser/trace.log
71+ target/jreleaser/output.properties
72+
73+ - name : Set next iteration version
74+ run : mvn -B -q versions:set -DnewVersion=${{ github.event.inputs.nextVersion }}-SNAPSHOT
75+
76+ - name : Commit, push and tag changes
77+ run : |
78+ git commit -m "Setting SNAPSHOT version ${{ github.event.inputs.nextVersion }}-SNAPSHOT" .
79+ git push origin ${{ github.event.inputs.branch }}
0 commit comments