Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove bintray and deploy to maven central #521

Merged
merged 3 commits into from
May 4, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 }}
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a bit of a guess but I assume we want the actual key here and not the key id or something else.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That variable is actually the file but base64 encoded. So it's the password encoded file that contains the key. See also the document I wrote in which I tried to explain that.

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>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

<!-- 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>