Skip to content

Commit e3795a1

Browse files
committed
Use GHA for publishing
1 parent b9d6715 commit e3795a1

7 files changed

+133
-118
lines changed
+66
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: Publish Releases
2+
3+
on:
4+
push:
5+
tags: ["**"]
6+
7+
jobs:
8+
# Run Gradle Wrapper Validation to verify the wrapper's checksum
9+
gradle-validation:
10+
name: Gradle Wrapper
11+
runs-on: ubuntu-latest
12+
if: github.repository_owner == 'taymyr'
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v3
16+
with:
17+
# we don't know what commit the last tag was
18+
fetch-depth: 0
19+
20+
- name: Gradle Wrapper Validation
21+
uses: gradle/wrapper-validation-action@v1
22+
23+
publish-artifacts:
24+
name: Publish Artifacts for Scala ${{ matrix.scala }}
25+
runs-on: ubuntu-latest
26+
if: github.repository_owner == 'taymyr'
27+
needs: gradle-validation
28+
strategy:
29+
matrix:
30+
include:
31+
- scala: "2.11"
32+
lagom: "1.4.15"
33+
- scala: "2.12"
34+
lagom: "1.5.5"
35+
- scala: "2.13"
36+
lagom: "1.6.4"
37+
steps:
38+
- name: Checkout
39+
uses: actions/checkout@v3
40+
with:
41+
# we don't know what commit the last tag was
42+
fetch-depth: 0
43+
- run: git fetch --tags --force origin # WA: https://github.com/actions/checkout/issues/882
44+
45+
- uses: actions/setup-java@v3
46+
with:
47+
distribution: 'liberica'
48+
java-version: '8'
49+
check-latest: true
50+
cache: 'gradle'
51+
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
52+
gpg-passphrase: ${{ secrets.GPG_PASSPHRASE }}
53+
54+
- name: Publish Releases
55+
run: >-
56+
./gradlew --no-daemon version publishToSonatype closeAndReleaseSonatypeStagingRepository -x test
57+
-PscalaBinaryVersion=${{ matrix.scala }} -PlagomVersion=${{ matrix.lagom }}
58+
-Psigning.gnupg.keyName=$GPG_KEY_ID
59+
-Psigning.gnupg.passphrase="$GPG_PASSPHRASE"
60+
-PsonatypeUsername="$OSSRH_USERNAME"
61+
-PsonatypePassword="$OSSRH_TOKEN"
62+
env:
63+
GPG_KEY_ID: ${{ secrets.GPG_KEY_ID }}
64+
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
65+
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
66+
OSSRH_TOKEN: ${{ secrets.OSSRH_TOKEN }}
+66
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: Publish Snapshots
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
jobs:
9+
# Run Gradle Wrapper Validation to verify the wrapper's checksum
10+
gradle-validation:
11+
name: Gradle Wrapper
12+
runs-on: ubuntu-latest
13+
if: github.repository_owner == 'taymyr'
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v3
17+
with:
18+
# we don't know what commit the last tag was
19+
fetch-depth: 0
20+
21+
- name: Gradle Wrapper Validation
22+
uses: gradle/wrapper-validation-action@v1
23+
24+
publish-artifacts:
25+
name: Publish Artifacts for Scala ${{ matrix.scala }}
26+
runs-on: ubuntu-latest
27+
if: github.repository_owner == 'taymyr'
28+
needs: gradle-validation
29+
strategy:
30+
matrix:
31+
include:
32+
- scala: "2.11"
33+
lagom: "1.4.15"
34+
- scala: "2.12"
35+
lagom: "1.5.5"
36+
- scala: "2.13"
37+
lagom: "1.6.4"
38+
steps:
39+
- name: Checkout
40+
uses: actions/checkout@v3
41+
with:
42+
# we don't know what commit the last tag was
43+
fetch-depth: 0
44+
45+
- uses: actions/setup-java@v3
46+
with:
47+
distribution: 'liberica'
48+
java-version: '8'
49+
check-latest: true
50+
cache: 'gradle'
51+
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
52+
gpg-passphrase: ${{ secrets.GPG_PASSPHRASE }}
53+
54+
- name: Publish Snapshots
55+
run: >-
56+
./gradlew --no-daemon version publishToSonatype -x test
57+
-PscalaBinaryVersion=${{ matrix.scala }} -PlagomVersion=${{ matrix.lagom }}
58+
-Psigning.gnupg.keyName=$GPG_KEY_ID
59+
-Psigning.gnupg.passphrase="$GPG_PASSPHRASE"
60+
-PsonatypeUsername="$OSSRH_USERNAME"
61+
-PsonatypePassword="$OSSRH_TOKEN"
62+
env:
63+
GPG_KEY_ID: ${{ secrets.GPG_KEY_ID }}
64+
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
65+
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
66+
OSSRH_TOKEN: ${{ secrets.OSSRH_TOKEN }}

.travis.yml

-60
This file was deleted.

bin/publish-release

-22
This file was deleted.

bin/publish-snapshots

-22
This file was deleted.

bin/scriptLib

-14
This file was deleted.

java/build.gradle.kts

+1
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ publishing {
152152
}
153153

154154
signing {
155+
useGpgCmd()
155156
isRequired = isReleaseVersion
156157
sign(publishing.publications["maven"])
157158
}

0 commit comments

Comments
 (0)