Skip to content

Commit

Permalink
Merge pull request #521 from graphql-java-kickstart/deploy-to-maven-c…
Browse files Browse the repository at this point in the history
…entral

Remove bintray and deploy to maven central
  • Loading branch information
oryan-block authored May 4, 2021
2 parents 5170c55 + 451a771 commit 018096d
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 40 deletions.
13 changes: 7 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,20 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Bintray
- name: Setup Maven Central
uses: actions/setup-java@v2
with:
java-version: '8'
distribution: 'adopt'
server-id: bintray
server-username: BINTRAY_USER
server-password: BINTRAY_PASS
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
gpg-private-key: ${{ secrets.GPG_KEY_CONTENTS }}
gpg-passphrase: GPG_PASSPHRASE
- name: Publish release
run: bash github-build.sh
env:
BINTRAY_USER: ${{ secrets.BINTRAY_USER }}
BINTRAY_PASS: ${{ secrets.BINTRAY_PASSWORD }}
MAVEN_USERNAME: ${{ secrets.OSS_USER_TOKEN_KEY }}
MAVEN_PASSWORD: ${{ secrets.OSS_USER_TOKEN_PASS }}
GPG_PASSPHRASE: ${{ secrets.GPG_SIGNING_PASSWORD }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
12 changes: 5 additions & 7 deletions .github/workflows/snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,16 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Bintray
- name: Setup Maven Central
uses: actions/setup-java@v2
with:
java-version: '8'
distribution: 'adopt'
server-id: bintray
server-username: BINTRAY_USER
server-password: BINTRAY_PASS
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
- name: Publish release
run: mvn --batch-mode -Pbintray deploy
run: mvn --batch-mode deploy
env:
BINTRAY_USER: ${{ secrets.BINTRAY_USER }}
BINTRAY_PASS: ${{ secrets.BINTRAY_PASSWORD }}
MAVEN_USERNAME: ${{ secrets.OSS_USER_TOKEN_KEY }}
MAVEN_PASSWORD: ${{ secrets.OSS_USER_TOKEN_PASS }}
4 changes: 2 additions & 2 deletions github-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ commitNextVersion() {
git config --global user.email "[email protected]"
git config --global user.name "GitHub Actions"

echo "Deploying release to Bintray"
echo "Deploying release to Maven Central"
removeSnapshots

mvn --batch-mode -Pbintray deploy
mvn --batch-mode -Prelease deploy

commitRelease
bumpVersion
Expand Down
63 changes: 38 additions & 25 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -243,15 +243,6 @@
</includes>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>2.5.3</version>
<configuration>
<tagNameFormat>@{project.version}</tagNameFormat>
<generateReleasePoms>false</generateReleasePoms>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
Expand Down Expand Up @@ -279,18 +270,30 @@
</goals>
<configuration>
<rules>
<dependencyConvergence />
<dependencyConvergence/>
</rules>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.6.8</version>
<extensions>true</extensions>
<configuration>
<serverId>ossrh</serverId>
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
<!-- temporarily set to false to test release deployment-->
<autoReleaseAfterClose>false</autoReleaseAfterClose>
</configuration>
</plugin>
</plugins>
</build>

<profiles>
<profile>
<id>bintray</id>
<id>release</id>
<build>
<plugins>
<plugin>
Expand All @@ -302,7 +305,7 @@
<id>attach-sources</id>
<phase>package</phase>
<goals>
<goal>jar</goal>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
Expand All @@ -320,6 +323,27 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.6</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
<configuration>
<!-- Prevent gpg from using pinentry programs -->
<gpgArguments>
<arg>--pinentry-mode</arg>
<arg>loopback</arg>
</gpgArguments>
</configuration>
</plugin>
</plugins>
</build>
</profile>
Expand All @@ -341,26 +365,15 @@
</licenses>
<distributionManagement>
<snapshotRepository>
<id>bintray</id>
<name>graphql-java-kickstart-graphql-java-tools</name>
<url>http://oss.jfrog.org/artifactory/oss-snapshot-local</url>
<id>ossrh</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
</snapshotRepository>

<!-- Released with: mvn release:clean release:prepare release:perform -B -e -Pbintray -->
<repository>
<id>bintray</id>
<name>graphql-java-kickstart-graphql-java-tools</name>
<url>
https://api.bintray.com/maven/graphql-java-kickstart/releases/graphql-java-tools/;publish=1
</url>
</repository>
</distributionManagement>
<scm>
<connection>scm:git:https://github.com/graphql-java-kickstart/graphql-java-tools.git
</connection>
<developerConnection>scm:git:https://github.com/graphql-java-kickstart/graphql-java-tools.git
</developerConnection>
<url>https://github.com/graphql-java-kickstart/graphql-java-tools</url>
<tag>HEAD</tag>
</scm>
</project>

0 comments on commit 018096d

Please sign in to comment.