Skip to content

Commit 12a0949

Browse files
[Java] Explore maven publishing, sonatype and alternatives (#209)
* Update gradle.properties * Create publishing.yml * Update gradle.properties * Update publishing.yml * Update publishing.yml
1 parent 33ae1ef commit 12a0949

File tree

2 files changed

+37
-7
lines changed

2 files changed

+37
-7
lines changed

.github/workflows/publishing.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Publish the Java SDK
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
deploy:
6+
description: 'Deploy?'
7+
required: true
8+
type: boolean
9+
jobs:
10+
build:
11+
name: Build and Test
12+
if: ${{ inputs.deploy }}
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v4
18+
19+
- name: Set up JDK 8
20+
uses: actions/setup-java@v3
21+
with:
22+
java-version: '8'
23+
distribution: 'corretto'
24+
25+
- name: Build and Test with Gradle
26+
run: ./gradlew build
27+
28+
- name: Publish SDK Library to Maven Central
29+
run: ./gradlew publishAllPublicationsToMavenCentralRepository --no-configuration-cache
30+
env:
31+
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.MAVEN_USERNAME }}
32+
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.MAVEN_PASSWORD }}
33+
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.GPG_KEY }}
34+
ORG_GRADLE_PROJECT_signingInMemoryKeyId: ${{ secrets.GPG_KEY_ID }}
35+
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.GPG_KEY_PASSWORD }}

gradle.properties

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,5 @@ POM_LICENCE_DIST=repo
3030

3131
POM_DEVELOPER_NAME=Countly
3232

33-
#SIGNING SECTION
34-
signing.keyId=xx
35-
signing.password=xx
36-
signing.secretKeyRingFile=xx
37-
38-
mavenCentralUsername=xx
39-
mavenCentralPassword=xx
33+
# Publishing properties
34+
SONATYPE_AUTOMATIC_RELEASE=true

0 commit comments

Comments
 (0)