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

Automatic release to Maven central #100

Merged
merged 2 commits into from
Aug 1, 2021

Conversation

pietrygamat
Copy link
Collaborator

@pietrygamat pietrygamat commented Aug 1, 2021

Currently there is no straight-forward way of doing deployment to Maven Central as it involves several manual steps when setting up the environment:

  • setting up right Java version to ensure the project is usable for the majority of end users
  • setting up published PGP key required for signing artifacts before they are accepted by Maven Central
  • setting up OSSRH credentials for actual artifact deployment and release

The idea behind this PR is to automate the process using Github actions and to take advantage of the repository secrets to store credentials and keys. I know the project already uses travis-ci, and it would be quite straight-forward to achieve the same goals using this tool, but moving to github actions has the benefit of keeping critical parts of the flow reusable by forks and simplifies access management.

What this change does NOT do, but perhaps we want another PR to cover:

  • Ensure the native libraries are build using the same revision for all plaforms
  • Update versions in pom.xml
  • Tag the exact revision sent to central
  • Automatically perform release to Github Releases

If this is to be accepted, the repository maintainer needs to create 4 repository secrets referenced in the workflow file. After that deploying to Maven Central is the question of pressing a button under Actions tab.

server-username: OSSRH_TOKEN_USERNAME
server-password: OSSRH_TOKEN_PASSWORD
gpg-private-key: ${{ secrets.JAVA_NATIVE_PGP_KEY }}
gpg-passphrase: PGP_KEY_PASSPHRASE
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@@ -543,5 +545,46 @@
</properties>
</profile>

<profile>
<id>maven-central-release</id>
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@pietrygamat pietrygamat merged commit 80fd3d4 into java-native:master Aug 1, 2021
@tresf
Copy link

tresf commented Aug 2, 2021

I know the project already uses travis-ci,

It did yes, but it's broken. Travis-Ci.org switched to Travis-CI.com completely breaking our project, so it's browsable and enabled but not firing since some time back in April.

@tresf
Copy link

tresf commented Aug 2, 2021

Ensure the native libraries are build using the same revision for all platforms

We don't necessarily do this today, which is why we offer a native lib version information. Automating building is pretty straightforward, if we decide to tackle this in the future. Solaris will be a bit of a pain, but we have the manual steps documented in the wiki.

@tresf
Copy link

tresf commented Aug 2, 2021

same revision for all platforms

If we automate this, I think this warrants a command line flag to overrides the version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants