4
4
workflow_dispatch : { }
5
5
6
6
jobs :
7
- build_and_deploy :
8
- name : Build and Deploy to Maven Central
7
+ build :
8
+ name : Release
9
9
runs-on : ubuntu-latest
10
10
steps :
11
11
- uses : actions/checkout@v4
12
12
- uses : ./.github/actions/setup-jdk
13
13
- uses : ./.github/actions/setup-maven-cache
14
- - uses : ./.github/actions/run-tests
15
14
16
15
- name : Prepare for release
17
16
run : ./mvnw versions:set -DremoveSnapshot=true -DgenerateBackupPoms=false
20
19
id : get_version
21
20
run : echo "VERSION=$(./mvnw -q -Dexec.executable=echo -Dexec.args='${project.version}' --non-recursive exec:exec)" >> $GITHUB_ENV
22
21
23
- - name : Deploy
22
+ - name : Build
24
23
run : ./mvnw -P release --batch-mode -DskipTests package
25
24
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
-
42
25
- name : Update README.md
43
26
run : sed -i "s|<version>.*</version>|<version>${{ env.VERSION }}</version>|g" README.md
44
27
61
44
with :
62
45
github_token : ${{ secrets.GITHUB_TOKEN }}
63
46
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
75
48
76
49
- name : Build Changelog
77
50
id : build_changelog
@@ -87,20 +60,15 @@ jobs:
87
60
env :
88
61
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
89
62
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
94
67
body : ${{steps.build_changelog.outputs.changelog}}
95
68
96
69
- 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
+ uses : AButler/upload-release-assets@v3.0
71
+ with :
72
+ files : " target/*.jar"
73
+ repo-token : ${{ secrets.GITHUB_TOKEN }}
74
+ release-id : ${{ steps.create_release.outputs.id }}
0 commit comments