File tree Expand file tree Collapse file tree 5 files changed +105
-7
lines changed Expand file tree Collapse file tree 5 files changed +105
-7
lines changed Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change @@ -74,6 +74,9 @@ publishing {
74
74
repositories {
75
75
// For the time being
76
76
mavenLocal()
77
+ maven {
78
+ url = uri(layout.buildDirectory.dir(" staging-deploy" ))
79
+ }
77
80
}
78
81
pom {
79
82
name = " Archipelago Java Library"
@@ -124,17 +127,40 @@ publishing {
124
127
}
125
128
126
129
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
+ }
127
142
deploy {
128
143
maven {
129
144
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
133
148
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" )
136
163
}
137
-
138
164
}
139
165
}
140
166
}
Original file line number Diff line number Diff line change 1
1
# This file was generated by the Gradle 'init' task.
2
2
# https://docs.gradle.org/current/userguide/build_environment.html#sec:gradle_configuration_properties
3
3
4
- org.gradle.configuration-cache =true
4
+ # jreleaser breaks with this
5
+ org.gradle.configuration-cache =false
5
6
You can’t perform that action at this time.
0 commit comments