Skip to content

Commit 99a82d2

Browse files
committed
Merge branch 'pr-update' of https://github.com/cjmang/Java-Client into pr-update
2 parents dd5e73a + 8e76542 commit 99a82d2

File tree

5 files changed

+105
-7
lines changed

5 files changed

+105
-7
lines changed

.github/workflows/release.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Publish to Maven Central
2+
3+
on:
4+
release:
5+
types: [released]
6+
tags:
7+
- 'v[0-9]+.[0-9]+.[0-9]+'
8+
9+
jobs:
10+
build:
11+
if: github
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v4
15+
- name: Set up JDK 17
16+
uses: actions/setup-java@v4
17+
with:
18+
java-version: '17'
19+
distribution: 'temurin'
20+
cache: gradle
21+
- name: Build with Gradle
22+
# This just publishes to the local file system; jreleaser is responsible for uploading to maven central
23+
run: ./gradlew publish
24+
- name: Upload to Maven Central
25+
env:
26+
# Needs to have access to the io.github.ArchipelagoMW namespace in maven central
27+
JRELEASER_MAVENCENTRAL_USERNAME: ${{ secrets.mavenCentralUsername }}
28+
JRELEASER_MAVENCENTRAL_TOKEN: ${{ secrets.mavenCentralToken }}
29+
# JRELEASER_DEPLOY_MAVEN_NEXUS2_USERNAME: ${{ secrets.mavenCentralUsername }}
30+
# JRELEASER_DEPLOY_MAVEN_NEXUS2_TOKEN: ${{ secrets.mavenCentralToken }}
31+
# The content uploaded to maven central needs to be signed. The public keys need to be published,
32+
# see https://central.sonatype.org/publish/requirements/gpg/#distributing-your-public-key for accepted
33+
# locations
34+
JRELEASER_GPG_PASSPHRASE: ${{ secrets.gpgPassphrase }}
35+
# The content here needs to be the values of the public and secret key pair
36+
JRELEASER_GPG_PUBLIC_KEY: ${{ secrets.gpgPublicKey }}
37+
JRELEASER_GPG_SECRET_KEY: ${{ secrets.gpgSecretKey }}
38+
run: ./gradlew jreleaserDeploy

.github/workflows/snapshot.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Publish to Maven Central
2+
3+
on:
4+
release:
5+
types: [prereleased]
6+
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v4
12+
- name: Set up JDK 17
13+
uses: actions/setup-java@v4
14+
with:
15+
java-version: '17'
16+
distribution: 'temurin'
17+
cache: gradle
18+
- name: Build with Gradle
19+
# This just publishes to the local file system; jreleaser is responsible for uploading to maven central
20+
run: ./gradlew publish
21+
- name: Upload to Maven Central Snapshots
22+
env:
23+
# Needs to have access to the io.github.ArchipelagoMW namespace in maven central
24+
JRELEASER_DEPLOY_MAVEN_NEXUS2_USERNAME: ${{ secrets.mavenCentralUsername }}
25+
JRELEASER_DEPLOY_MAVEN_NEXUS2_TOKEN: ${{ secrets.mavenCentralToken }}
26+
# The content uploaded to maven central needs to be signed. The public keys need to be published,
27+
# see https://central.sonatype.org/publish/requirements/gpg/#distributing-your-public-key for accepted
28+
# locations
29+
JRELEASER_GPG_PASSPHRASE: ${{ secrets.gpgPassphrase }}
30+
# The content here needs to be the values of the public and secret key pair
31+
JRELEASER_GPG_PUBLIC_KEY: ${{ secrets.gpgPublicKey }}
32+
JRELEASER_GPG_SECRET_KEY: ${{ secrets.gpgSecretKey }}
33+
run: ./gradlew jreleaserDeploy

build.gradle.kts

Lines changed: 32 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,9 @@ publishing {
7474
repositories {
7575
// For the time being
7676
mavenLocal()
77+
maven {
78+
url = uri(layout.buildDirectory.dir("staging-deploy"))
79+
}
7780
}
7881
pom {
7982
name = "Archipelago Java Library"
@@ -124,17 +127,40 @@ publishing {
124127
}
125128

126129
jreleaser {
130+
signing {
131+
active = Active.ALWAYS
132+
armored = true
133+
}
134+
release {
135+
github {
136+
enabled = true
137+
repoOwner = "ArchipelagoMW"
138+
overwrite = false
139+
skipRelease = true
140+
}
141+
}
127142
deploy {
128143
maven {
129144
mavenCentral {
130-
register("javaClient") {
131-
dryrun = true
132-
active = Active.RELEASE
145+
register("release-deploy") {
146+
// Turning off releases for testing purposes
147+
active = Active.NEVER
133148
applyMavenCentralRules = true
134-
sign = false
135-
stagingRepository("target/staging-deploy")
149+
url = "https://central.sonatype.com/api/v1/publisher"
150+
stagingRepository("build/staging-deploy")
151+
}
152+
}
153+
nexus2 {
154+
register("snapshot-deploy") {
155+
active = Active.SNAPSHOT
156+
applyMavenCentralRules = true
157+
snapshotSupported = true
158+
closeRepository = true
159+
releaseRepository = true
160+
url = "https://central.sonatype.com/api/v1/publisher"
161+
snapshotUrl = "https://central.sonatype.com/repository/maven-snapshots/"
162+
stagingRepository("build/staging-deploy")
136163
}
137-
138164
}
139165
}
140166
}

gradle.properties

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# This file was generated by the Gradle 'init' task.
22
# https://docs.gradle.org/current/userguide/build_environment.html#sec:gradle_configuration_properties
33

4-
org.gradle.configuration-cache=true
4+
# jreleaser breaks with this
5+
org.gradle.configuration-cache=false
56

gradlew

100644100755
File mode changed.

0 commit comments

Comments
 (0)