Skip to content

Commit fde1b5b

Browse files
chore: bump version for maven central publishing
1 parent 14f3701 commit fde1b5b

File tree

6 files changed

+71
-17
lines changed

6 files changed

+71
-17
lines changed

.github/workflows/gradle-publish.yml renamed to .github/workflows/gradle-publish-github.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# This workflow will build a package using Gradle and then publish it to GitHub packages when a release is created
66
# For more information see: https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#Publishing-using-gradle
77

8-
name: Gradle Package
8+
name: Gradle Package (GitHub)
99

1010
on:
1111
release:
@@ -39,7 +39,7 @@ jobs:
3939
# The USERNAME and TOKEN need to correspond to the credentials environment variables used in
4040
# the publishing section of your build.gradle
4141
- name: Publish to GitHub Packages
42-
run: ./gradlew publish
42+
run: ./gradlew publish -Prepo=GitHubPackages
4343
env:
4444
GITHUB_ACTOR: ${{ github.actor }}
4545
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# This workflow uses actions that are not certified by GitHub.
2+
# They are provided by a third-party and are governed by
3+
# separate terms of service, privacy policy, and support
4+
# documentation.
5+
# This workflow will build a package using Gradle and then publish it to GitHub packages when a release is created
6+
# For more information see: https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#Publishing-using-gradle
7+
8+
name: Gradle Package (Maven)
9+
10+
on:
11+
release:
12+
types: [created]
13+
14+
jobs:
15+
build:
16+
environment: prod
17+
18+
runs-on: ubuntu-latest
19+
permissions:
20+
contents: read
21+
packages: write
22+
23+
steps:
24+
- uses: actions/checkout@v4
25+
- name: Set up JDK 23
26+
uses: actions/setup-java@v4
27+
with:
28+
java-version: '23'
29+
distribution: 'temurin'
30+
server-id: github # Value of the distributionManagement/repository/id field of the pom.xml
31+
settings-path: ${{ github.workspace }} # location for the settings.xml file
32+
33+
- name: Setup Gradle
34+
uses: gradle/actions/setup-gradle@af1da67850ed9a4cedd57bfd976089dd991e2582 # v4.0.0
35+
36+
- name: Build with Gradle
37+
run: ./gradlew build
38+
39+
# The USERNAME and TOKEN need to correspond to the credentials environment variables used in
40+
# the publishing section of your build.gradle
41+
- name: Publish to Sonatype (Maven)
42+
run: ./gradlew publish -Prepo=Sonatype
43+
env:
44+
GITHUB_ACTOR: ${{ github.actor }}
45+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
46+
SONATYPE_USER: ${{ secrets.SONATYPE_USER }}
47+
SONATYPE_TOKEN: ${{ secrets.SONATYPE_TOKEN }}
48+
SIGNING_KEY_ID: ${{ secrets.SIGNING_KEY_ID }}
49+
SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
50+
SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }}
51+

api/build.gradle.kts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -169,8 +169,9 @@ logger.lifecycle(" • signingKeyId: ${signingKeyId != null}")
169169
logger.lifecycle(" • signingKey present: ${signingKey != null}")
170170
logger.lifecycle(" • signingPassword present: ${signingPassword != null}")
171171
logger.lifecycle(" • shouldSign: $shouldSign")
172-
signing {
173-
setRequired({ isPublishing && shouldSign })
174-
useInMemoryPgpKeys(signingKeyId, signingKey, signingPassword)
175-
sign(configurations.runtimeElements.get())
176-
}
172+
if (isPublishing && shouldSign) {
173+
signing {
174+
useInMemoryPgpKeys(signingKeyId, signingKey, signingPassword)
175+
sign(configurations.runtimeElements.get())
176+
}
177+
}

app/build.gradle.kts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -237,8 +237,9 @@ logger.lifecycle(" • signingKeyId: ${signingKeyId != null}")
237237
logger.lifecycle(" • signingKey present: ${signingKey != null}")
238238
logger.lifecycle(" • signingPassword present: ${signingPassword != null}")
239239
logger.lifecycle(" • shouldSign: $shouldSign")
240-
signing {
241-
setRequired({ isPublishing && shouldSign })
242-
useInMemoryPgpKeys(signingKeyId, signingKey, signingPassword)
243-
sign(configurations.runtimeElements.get())
244-
}
240+
if (isPublishing && shouldSign) {
241+
signing {
242+
useInMemoryPgpKeys(signingKeyId, signingKey, signingPassword)
243+
sign(configurations.runtimeElements.get())
244+
}
245+
}

buildSrc/src/main/kotlin/buildlogic.java-common-conventions.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ testing {
7070
}
7171
}
7272

73-
val projectVersion by extra("2.0.9")
73+
val projectVersion by extra("2.0.11")
7474

7575
public val jdkVersion = 24
7676
// Apply a specific Java toolchain to ease working on different environments.

tcp-gameserver/build.gradle.kts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -158,8 +158,9 @@ logger.lifecycle(" • signingKeyId: ${signingKeyId != null}")
158158
logger.lifecycle(" • signingKey present: ${signingKey != null}")
159159
logger.lifecycle(" • signingPassword present: ${signingPassword != null}")
160160
logger.lifecycle(" • shouldSign: $shouldSign")
161-
signing {
162-
setRequired({ isPublishing && shouldSign })
163-
useInMemoryPgpKeys(signingKeyId, signingKey, signingPassword)
164-
sign(configurations.runtimeElements.get())
161+
if (isPublishing && shouldSign) {
162+
signing {
163+
useInMemoryPgpKeys(signingKeyId, signingKey, signingPassword)
164+
sign(configurations.runtimeElements.get())
165+
}
165166
}

0 commit comments

Comments
 (0)