44 workflow_dispatch : { }
55
66jobs :
7- build_and_deploy :
8- name : Build and Deploy to Maven Central
7+ build :
8+ name : Release
99 runs-on : ubuntu-latest
1010 steps :
1111 - uses : actions/checkout@v4
1212 - uses : ./.github/actions/setup-jdk
1313 - uses : ./.github/actions/setup-maven-cache
14- - uses : ./.github/actions/run-tests
1514
1615 - name : Prepare for release
1716 run : ./mvnw versions:set -DremoveSnapshot=true -DgenerateBackupPoms=false
2019 id : get_version
2120 run : echo "VERSION=$(./mvnw -q -Dexec.executable=echo -Dexec.args='${project.version}' --non-recursive exec:exec)" >> $GITHUB_ENV
2221
23- - name : Deploy
22+ - name : Build
2423 run : ./mvnw -P release --batch-mode -DskipTests package
2524
26- - name : Upload JARs as artifact
27- uses : actions/upload-artifact@v2
28- with :
29- name : jars
30- path : ./target/*.jar
31-
32- commit_and_tag :
33- name : Commit and Tag
34- needs : build_and_deploy
35- runs-on : ubuntu-latest
36- steps :
37- - uses : ./.github/actions/setup-jdk
38-
39- - name : Set version
40- run : ./mvnw versions:set -DnewVersion=${{ env.VERSION }} -DgenerateBackupPoms=false
41-
4225 - name : Update README.md
4326 run : sed -i "s|<version>.*</version>|<version>${{ env.VERSION }}</version>|g" README.md
4427
6144 with :
6245 github_token : ${{ secrets.GITHUB_TOKEN }}
6346 branch : ${{ github.ref }}
64-
65- create_github_release_and_attach_artifacts :
66- name : Create GitHub Release and attach artifacts
67- needs : commit_and_tag
68- runs-on : ubuntu-latest
69- steps :
70- - name : Download build artifacts
71- uses : actions/download-artifact@v2
72- with :
73- name : build-artifacts
74- path : ./target
47+ tags : true
7548
7649 - name : Build Changelog
7750 id : build_changelog
@@ -87,20 +60,15 @@ jobs:
8760 env :
8861 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
8962 with :
90- tag_name : ${{ steps.get_version.output.version }}
91- release_name : Release ${{ steps.get_version.output.version }}
92- draft : false
93- prerelease : false
63+ tag_name : ${{ env.VERSION }}
64+ release_name : Release ${{ env.VERSION }}
65+ draft : true
66+ prerelease : true
9467 body : ${{steps.build_changelog.outputs.changelog}}
9568
9669 - name : Upload all jars to Release
97- run : |
98- for file in ./target/*.jar; do
99- echo "Uploading $file"
100- curl \
101- -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
102- -H "Content-Type: $(file -b --mime-type $file)" \
103- --data-binary @"$file" \
104- "${{ steps.create_release.outputs.upload_url }}?name=$(basename $file)"
105- done
106- shell : bash
70+ 71+ with :
72+ files : " target/*.jar"
73+ repo-token : ${{ secrets.GITHUB_TOKEN }}
74+ release-id : ${{ steps.create_release.outputs.id }}
0 commit comments