Skip to content

Commit 018096d

Browse files
authored
Merge pull request #521 from graphql-java-kickstart/deploy-to-maven-central
Remove bintray and deploy to maven central
2 parents 5170c55 + 451a771 commit 018096d

File tree

4 files changed

+52
-40
lines changed

4 files changed

+52
-40
lines changed

.github/workflows/release.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,20 @@ jobs:
2020
steps:
2121
- name: Checkout
2222
uses: actions/checkout@v2
23-
- name: Setup Bintray
23+
- name: Setup Maven Central
2424
uses: actions/setup-java@v2
2525
with:
2626
java-version: '8'
2727
distribution: 'adopt'
28-
server-id: bintray
29-
server-username: BINTRAY_USER
30-
server-password: BINTRAY_PASS
28+
server-id: ossrh
29+
server-username: MAVEN_USERNAME
30+
server-password: MAVEN_PASSWORD
31+
gpg-private-key: ${{ secrets.GPG_KEY_CONTENTS }}
32+
gpg-passphrase: GPG_PASSPHRASE
3133
- name: Publish release
3234
run: bash github-build.sh
3335
env:
34-
BINTRAY_USER: ${{ secrets.BINTRAY_USER }}
35-
BINTRAY_PASS: ${{ secrets.BINTRAY_PASSWORD }}
3636
MAVEN_USERNAME: ${{ secrets.OSS_USER_TOKEN_KEY }}
3737
MAVEN_PASSWORD: ${{ secrets.OSS_USER_TOKEN_PASS }}
38+
GPG_PASSPHRASE: ${{ secrets.GPG_SIGNING_PASSWORD }}
3839
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/snapshot.yml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,16 @@ jobs:
2323
steps:
2424
- name: Checkout
2525
uses: actions/checkout@v2
26-
- name: Setup Bintray
26+
- name: Setup Maven Central
2727
uses: actions/setup-java@v2
2828
with:
2929
java-version: '8'
3030
distribution: 'adopt'
31-
server-id: bintray
32-
server-username: BINTRAY_USER
33-
server-password: BINTRAY_PASS
31+
server-id: ossrh
32+
server-username: MAVEN_USERNAME
33+
server-password: MAVEN_PASSWORD
3434
- name: Publish release
35-
run: mvn --batch-mode -Pbintray deploy
35+
run: mvn --batch-mode deploy
3636
env:
37-
BINTRAY_USER: ${{ secrets.BINTRAY_USER }}
38-
BINTRAY_PASS: ${{ secrets.BINTRAY_PASSWORD }}
3937
MAVEN_USERNAME: ${{ secrets.OSS_USER_TOKEN_KEY }}
4038
MAVEN_PASSWORD: ${{ secrets.OSS_USER_TOKEN_PASS }}

github-build.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,10 @@ commitNextVersion() {
4343
git config --global user.email "actions@github.com"
4444
git config --global user.name "GitHub Actions"
4545

46-
echo "Deploying release to Bintray"
46+
echo "Deploying release to Maven Central"
4747
removeSnapshots
4848

49-
mvn --batch-mode -Pbintray deploy
49+
mvn --batch-mode -Prelease deploy
5050

5151
commitRelease
5252
bumpVersion

pom.xml

Lines changed: 38 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -243,15 +243,6 @@
243243
</includes>
244244
</configuration>
245245
</plugin>
246-
<plugin>
247-
<groupId>org.apache.maven.plugins</groupId>
248-
<artifactId>maven-release-plugin</artifactId>
249-
<version>2.5.3</version>
250-
<configuration>
251-
<tagNameFormat>@{project.version}</tagNameFormat>
252-
<generateReleasePoms>false</generateReleasePoms>
253-
</configuration>
254-
</plugin>
255246
<plugin>
256247
<groupId>org.apache.maven.plugins</groupId>
257248
<artifactId>maven-jar-plugin</artifactId>
@@ -279,18 +270,30 @@
279270
</goals>
280271
<configuration>
281272
<rules>
282-
<dependencyConvergence />
273+
<dependencyConvergence/>
283274
</rules>
284275
</configuration>
285276
</execution>
286277
</executions>
287278
</plugin>
279+
<plugin>
280+
<groupId>org.sonatype.plugins</groupId>
281+
<artifactId>nexus-staging-maven-plugin</artifactId>
282+
<version>1.6.8</version>
283+
<extensions>true</extensions>
284+
<configuration>
285+
<serverId>ossrh</serverId>
286+
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
287+
<!-- temporarily set to false to test release deployment-->
288+
<autoReleaseAfterClose>false</autoReleaseAfterClose>
289+
</configuration>
290+
</plugin>
288291
</plugins>
289292
</build>
290293

291294
<profiles>
292295
<profile>
293-
<id>bintray</id>
296+
<id>release</id>
294297
<build>
295298
<plugins>
296299
<plugin>
@@ -302,7 +305,7 @@
302305
<id>attach-sources</id>
303306
<phase>package</phase>
304307
<goals>
305-
<goal>jar</goal>
308+
<goal>jar-no-fork</goal>
306309
</goals>
307310
</execution>
308311
</executions>
@@ -320,6 +323,27 @@
320323
</execution>
321324
</executions>
322325
</plugin>
326+
<plugin>
327+
<groupId>org.apache.maven.plugins</groupId>
328+
<artifactId>maven-gpg-plugin</artifactId>
329+
<version>1.6</version>
330+
<executions>
331+
<execution>
332+
<id>sign-artifacts</id>
333+
<phase>verify</phase>
334+
<goals>
335+
<goal>sign</goal>
336+
</goals>
337+
</execution>
338+
</executions>
339+
<configuration>
340+
<!-- Prevent gpg from using pinentry programs -->
341+
<gpgArguments>
342+
<arg>--pinentry-mode</arg>
343+
<arg>loopback</arg>
344+
</gpgArguments>
345+
</configuration>
346+
</plugin>
323347
</plugins>
324348
</build>
325349
</profile>
@@ -341,26 +365,15 @@
341365
</licenses>
342366
<distributionManagement>
343367
<snapshotRepository>
344-
<id>bintray</id>
345-
<name>graphql-java-kickstart-graphql-java-tools</name>
346-
<url>http://oss.jfrog.org/artifactory/oss-snapshot-local</url>
368+
<id>ossrh</id>
369+
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
347370
</snapshotRepository>
348-
349-
<!-- Released with: mvn release:clean release:prepare release:perform -B -e -Pbintray -->
350-
<repository>
351-
<id>bintray</id>
352-
<name>graphql-java-kickstart-graphql-java-tools</name>
353-
<url>
354-
https://api.bintray.com/maven/graphql-java-kickstart/releases/graphql-java-tools/;publish=1
355-
</url>
356-
</repository>
357371
</distributionManagement>
358372
<scm>
359373
<connection>scm:git:https://github.com/graphql-java-kickstart/graphql-java-tools.git
360374
</connection>
361375
<developerConnection>scm:git:https://github.com/graphql-java-kickstart/graphql-java-tools.git
362376
</developerConnection>
363377
<url>https://github.com/graphql-java-kickstart/graphql-java-tools</url>
364-
<tag>HEAD</tag>
365378
</scm>
366379
</project>

0 commit comments

Comments
 (0)