5
5
# This workflow will build a package using Gradle and then publish it to GitHub packages when a release is created
6
6
# For more information see: https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#Publishing-using-gradle
7
7
8
+ # maven deploy commands via via https://tech.clevertap.com/automate-releases-to-maven-central-via-github-actions/
9
+
8
10
name : Release
9
11
10
12
on :
@@ -26,16 +28,34 @@ jobs:
26
28
with :
27
29
java-version : ' 8'
28
30
distribution : ' temurin'
29
- - name : Build with Gradle
30
- uses : gradle/gradle-build-action@0d13054264b0bb894ded474f08ebb30921341cee
31
- with :
32
- arguments : build
33
- # The USERNAME and TOKEN need to correspond to the credentials environment variables used in
34
- # the publishing section of your build.gradle
35
- - name : Publish to Sonatype (Maven)
36
- uses : gradle/gradle-build-action@0d13054264b0bb894ded474f08ebb30921341cee
31
+ cache : maven
32
+ server-id : ossrh
33
+ server-username : ${{ secrets.OSSRH_USERNAME }}
34
+ server-password : ${{ secrets.OSSRH_PASSWORD }}
35
+
36
+ - name : Configure GPG Key
37
+ run : |
38
+ echo -n "$GPG_SIGNING_KEY" | base64 --decode | gpg --import
39
+ env :
40
+ GPG_SIGNING_KEY : ${{ secrets.GPG_SIGNING_KEY }}
41
+
42
+ - name : Build with Maven
43
+ run : mvn --batch-mode --update-snapshots verify
44
+
45
+ - name : Upload coverage to Codecov
46
+ uses : codecov/codecov-action@v2
37
47
with :
38
- arguments : publish -PossrhUsername=${{ secrets.OSSRH_USERNAME }} -PossrhPassword=${{ secrets.OSSRH_PASSWORD }}
48
+ directory : lib/build
49
+ flags : unittests # optional
50
+ name : coverage # optional
51
+ fail_ci_if_error : true # optional (default = false)
52
+ verbose : true # optional (default = false)
53
+ - name : Deploy
54
+ run : |
55
+ mvn -P gpg_verify \
56
+ --no-transfer-progress \
57
+ --batch-mode \
58
+ --file pom.xml -s release/m2-settings.xml verify deploy
39
59
env :
40
- release : true
41
- REPOSITORY_URL : https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/
60
+ OSSRH_USERNAME : ${{ secrets.OSSRH_USERNAME }}
61
+ OSSRH_PASSWORD : ${{ secrets.OSSRH_PASSWORD }}
0 commit comments