11name : Release
22
33on :
4- push :
5- tags :
6- - " v*"
4+ workflow_dispatch :
5+ inputs :
6+ version :
7+ description : ' Release version'
8+ required : true
79
810jobs :
9- Release :
11+ release :
12+ name : Release
1013 runs-on : ubuntu-latest
11- env :
12- CI : true
1314 steps :
15+ - name : Cancel previous run
16+ 17+ with :
18+ access_token : ${{ secrets.GITHUB_TOKEN }}
19+
1420 - uses : actions/checkout@v4
21+ with :
22+ fetch-depth : 0
1523
16- - name : Set up JDK 11
24+ - name : Set up Java
1725 uses : actions/setup-java@v4
1826 with :
1927 java-version : 11
2028 distribution : zulu
2129 cache : gradle
2230
23- - name : Release
24- run : ./gradlew -PreproducibleBuild=true -Prelease=true -Pgradle.publish.key=${{ secrets.GRADLE_PUBLISH_KEY }} -Pgradle.publish.secret=${{ secrets.GRADLE_PUBLISH_SECRET }} publishPlugins
25-
26- - name : Generate changelog
27- id : changelog
28- 29- with :
30- myToken : ${{ secrets.GITHUB_TOKEN }}
31+ - name : Set release version
32+ run : |
33+ VERSION=${{ github.event.inputs.version }}
34+ sed -i -e "s/^\:project-version\:\ .*/:project-version: ${VERSION}/g" README.adoc
35+ git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
36+ git config --global user.name "GitHub Action"
37+ git commit -a -m "Releasing version $VERSION"
38+ git push origin main
3139
32- - name : Create GitHub Release
33- id : create_release
34- uses : actions/create-release@v1
40+ - name : Deploy to Plugin Portal
3541 env :
36- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
42+ GRADLE_PUBLISH_KEY : ${{ secrets.GRADLE_PUBLISH_KEY }}
43+ GRADLE_PUBLISH_SECRET : ${{ secrets.GRADLE_PUBLISH_SECRET }}
44+ run : ./gradlew -Prelease=true -Pfull-release=true -PreproducibleBuild=true publishPlugins -S
45+
46+ - name : Release
47+ uses : jreleaser/release-action@v2
3748 with :
38- tag_name : ${{ github.ref }}
39- release_name : Release ${{ github.ref }}
40- body : |
41- https://plugins.gradle.org/plugin/dev.jbang
42-
43- ### Changelog
44- ${{ steps.changelog.outputs.changelog }}
45- draft : false
46- prerelease : false
47-
48- - name : Version
49- id : version
50- run : echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\/v/}
51-
52- - name : Announce
53- uses : ethomson/send-tweet-action@v1
49+ arguments : full-release
50+ env :
51+ JRELEASER_PROJECT_VERSION : ${{ github.event.inputs.version }}
52+ JRELEASER_GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
53+ JRELEASER_GPG_PASSPHRASE : ${{ secrets.GPG_PASSPHRASE }}
54+ JRELEASER_GPG_PUBLIC_KEY : ${{ secrets.GPG_PUBLIC_KEY }}
55+ JRELEASER_GPG_SECRET_KEY : ${{ secrets.GPG_SECRET_KEY }}
56+ JRELEASER_BLUESKY_PASSWORD : ${{ secrets.BLUESKY_PASSWORD }}
57+
58+ - name : JReleaser output
59+ if : always()
60+ uses : actions/upload-artifact@v4
5461 with :
55- status : " jbang gradle plugin v${{ steps.version.outputs.VERSION }} released https://plugins.gradle.org/plugin/dev.jbang"
56- consumer-key : ${{ secrets.TWITTER_API_KEY }}
57- consumer-secret : ${{ secrets.TWITTER_API_SECRET_KEY }}
58- access-token : ${{ secrets.TWITTER_ACCESS_TOKEN }}
59- access-token-secret : ${{ secrets.TWITTER_ACCESS_TOKEN_SECRET }}
62+ name : artifact
63+ path : |
64+ out/jreleaser/trace.log
65+ out/jreleaser/output.properties
0 commit comments