Skip to content

Commit 1382b7e

Browse files
committed
Use GitHub Actions to sign and publish the artifacts
1 parent dd6a86f commit 1382b7e

20 files changed

+151
-375
lines changed
File renamed without changes.
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Publish package to Sonatype OSS Maven2
2+
on:
3+
release:
4+
types: [created]
5+
branches: [main]
6+
jobs:
7+
publish-release:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v3
11+
- uses: actions/setup-java@v3
12+
with:
13+
java-version: '11'
14+
distribution: 'temurin'
15+
- uses: gradle/wrapper-validation-action@v1
16+
- name: Publish maproulette-java-client
17+
env:
18+
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
19+
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
20+
# These three GPG vars are required to create the signed *.asc files used to validate each artifact
21+
GPG_KEY_LOCATION: ${{ secrets.GPG_KEY_LOCATION }}
22+
GPG_KEY_ID: ${{ secrets.GPG_KEY_ID }}
23+
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
24+
run: |
25+
# Remove the '-SNAPSHOT' from the version because this is a 'release' build, not a snapshot/staging build.
26+
# There are gradle ways to do this based on input properties or env, but for now keep it simple
27+
sed -i "s/-SNAPSHOT//g" gradle.properties
28+
./gradlew build
29+
./gradlew publish \
30+
-Psigning.secretKeyRingFile=${GPG_KEY_LOCATION} \
31+
-Psigning.keyId=${GPG_KEY_ID} \
32+
-Psigning.password=${GPG_PASSPHRASE}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Publish package to Sonatype OSS Snapshots
2+
on:
3+
workflow_run:
4+
workflows: [CI Build]
5+
types: [completed]
6+
branches: [main, dev]
7+
jobs:
8+
publish-snapshot:
9+
runs-on: ubuntu-latest
10+
if: ${{ github.event.workflow_run.conclusion == 'success' }}
11+
steps:
12+
- uses: actions/checkout@v3
13+
- uses: actions/setup-java@v3
14+
with:
15+
java-version: '11'
16+
distribution: 'temurin'
17+
- uses: gradle/wrapper-validation-action@v1
18+
- name: Publish maproulette-java-client
19+
env:
20+
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
21+
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
22+
# These three GPG vars are required to create the signed *.asc files used to validate each artifact
23+
GPG_KEY_LOCATION: ${{ secrets.GPG_KEY_LOCATION }}
24+
GPG_KEY_ID: ${{ secrets.GPG_KEY_ID }}
25+
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
26+
run: |
27+
./gradlew build
28+
./gradlew publish \
29+
-PpublishSnapshot=true \
30+
-Psigning.secretKeyRingFile=${GPG_KEY_LOCATION} \
31+
-Psigning.keyId=${GPG_KEY_ID} \
32+
-Psigning.password=${GPG_PASSPHRASE}

.github/workflows/pull-request.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ jobs:
5252
run: |
5353
pushd java-client
5454
./gradlew build
55+
# Publish the artifacts and pom to a local directory for later inspection
56+
./gradlew publish
5557
5658
- name: Build maproulette-backend sbt
5759
run: |
@@ -87,13 +89,13 @@ jobs:
8789
popd
8890
pushd java-client
8991
./gradlew --info --project-prop runIntegrationTests \
90-
clean integrationTest \
92+
integrationTest \
9193
--tests '*BatchUploaderIntegrationTest*' \
9294
--tests '*ChallengeAPIIntegrationTest*'
9395
9496
validation:
9597
name: "Gradle Validation"
9698
runs-on: ubuntu-latest
9799
steps:
98-
- uses: actions/checkout@v2
99-
- uses: gradle/wrapper-validation-action@v1.0.4
100+
- uses: actions/checkout@v3
101+
- uses: gradle/wrapper-validation-action@v1

.github/workflows/release.yml

Lines changed: 0 additions & 21 deletions
This file was deleted.

.travis.yml

Lines changed: 0 additions & 32 deletions
This file was deleted.

.travis/build.sh

Lines changed: 0 additions & 21 deletions
This file was deleted.

.travis/deploy-gate.sh

Lines changed: 0 additions & 12 deletions
This file was deleted.

.travis/deploy.sh

Lines changed: 0 additions & 11 deletions
This file was deleted.

0 commit comments

Comments
 (0)