-
Notifications
You must be signed in to change notification settings - Fork 9
Add ability to publish to bintray and central #3
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
Add ability to publish to bintray and central #3
Conversation
|
I think we want to aim for central directly, we can definitely help with those creds 👍 |
|
OK, if you think that we should aim for mavenCentral, then there are some additional changes that needs to be made. I'll follow this guide https://medium.com/@nmauti/sign-and-publish-on-maven-central-a-project-with-the-new-maven-publish-gradle-plugin-22a72a4bfd4b and update the PR with necessary changes. |
|
I've ended-up following the official guide: https://central.sonatype.org/pages/gradle.html To release the jar you'll need to:
|
|
I guess this PR should be merged to develop. |
|
Is there anything I can do to have it released? |
|
Sorry, I was "out" last week. We actually don't use sonatype directly but rather bintray which is then mirrored. It seems there is a plugin for gradle: https://github.com/bintray/gradle-bintray-plugin. We usually have the following four env variables:
in our .travis.yml (I can take care of inputting those). and then a small script that actually takes care of publishing. You can check out https://github.com/snowplow/snowplow-android-tracker/blob/master/.travis/deploy.sh and https://github.com/snowplow/snowplow-android-tracker/blob/master/.travis.yml#L46-L51 The example above only publishes to bintray but I'd think it's not terribly hard to do the mirroring with the |
|
I've followed the README of the gradle-bintray-plugin, but didn't have a chance to test it e2e ... I hope it will work ;) |
|
@BenFradet would you have some time this week to approve this PR, merge to master and do the release? The build.gradle:
|
BenFradet
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, just a couple of minor comments 👍
build.gradle
Outdated
| key = System.getenv('BINTRAY_API_KEY') | ||
|
|
||
| pkg { | ||
| repo = 'maven' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's snowplow-maven
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
build.gradle
Outdated
| repo = 'maven' | ||
| name = archivesBaseName | ||
| licenses = ['Apache-2.0'] | ||
| vcsUrl = 'https://github.com/snowplow-referer-parser/java-referer-parser' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we need the .git extension
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right (verified examples in the gradle-bintray-plugin). Fixed.
| version { | ||
| name = version | ||
| gpg { | ||
| sign = true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we have a key so this will most likely fail
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's obligatory to have signing enabled.
https://github.com/bintray/gradle-bintray-plugin#Maven_Central_Sync
(...) also files must be signed to be sent to Maven Central, so GPG file signing should be enabled (see above) if Maven Central sync is enabled
Here is an article how to create a signature:
https://medium.com/@nmauti/publishing-a-project-on-maven-central-8106393db2c3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah indeed, didn't know bintray did it for us: https://github.com/bintray/gradle-bintray-plugin#gpg-file-signing
BenFradet
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, can you just make the deploy.sh file executable?
|
I didn't even know that it's possible ;) Good - learning new things :) |
|
As part of hacktoberfest, we have a raffle to win Snowplow t-shirts. |
|
This PR got merged to develop, what needs to be done to deploy it to maven central? |
|
sorry this dropped off my radar, I'll try publishing an RC today |
Added the maven-publish to enable releasing artefacts to maven repository.
My goal is to have 0.4.0 released to 'http://maven.snplow.com/releases/'. Could you @BenFradet help here?
To release the 0.4.0 artifact all you need to do is: