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 #101

Merged
merged 1 commit into from
Sep 20, 2021

Conversation

pietrygamat
Copy link
Collaborator

@pietrygamat pietrygamat commented Aug 2, 2021

(Reopen of wrongly closed #100) -- revised

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.

Goals:

  • Reproducible, transparent and auditable build mechanism for Maven Central deployment.
  • Everything requrired for a Maven Central deployment is contained within this GitHub repository and nowhere else (not on external CI, not in maintainers PC).
  • Repository secrets set up
  • pom.xml version is bumped automatically; release is always done from non-snapshot version, and next snapshot version is set in the source after (automatic commits)
  • Exact git revision from which the release build was created is appropriately tagged in the repository (no rebase on merge, etc)
  • Deployment can be triggered with GitHub UI (by project collaborators)

Non-goals (pending separate PRs)

  • Building native libraries. Native libraries are part of the source in this project, so it is assumed they have all been commited before triggering the build. Only pom.xml is updated.
  • Repository maintenance: wiki or readme are not part of the bundle deployed to Maven Central, and are not touched.
  • Github Release. Creating or describing Github release or building fat jar that is normally published there are not done - has to be done from a tagged commit manually.

If this is to be accepted, the repository maintainer (which is not me) needs to create 4 repository secrets referenced in the workflow file: token login + password to https://oss.sonatype.org/ with permission in io.github.java-native and published GPG key + passphrase for signing the artifacts.

After that deploying to Maven Central is the question of pressing a button under Actions tab (and optionally - confirming the release in Nexus, but we may include it in the workflow - opinions?)

@pietrygamat pietrygamat force-pushed the maven-autorelease branch 2 times, most recently from fc1552e to 70cc150 Compare August 4, 2021 10:59
@pietrygamat
Copy link
Collaborator Author

Non-Goals listed in the description can be achieved by:

@pietrygamat pietrygamat force-pushed the maven-autorelease branch 2 times, most recently from 704d8ad to 7ecae98 Compare August 7, 2021 20:23
@pietrygamat pietrygamat force-pushed the maven-autorelease branch 2 times, most recently from 43a738f to fead41e Compare August 18, 2021 18:52
@pietrygamat pietrygamat force-pushed the maven-autorelease branch 2 times, most recently from ff92dc9 to 4fa40ca Compare September 9, 2021 00:34
@pietrygamat pietrygamat mentioned this pull request Sep 9, 2021
@pietrygamat pietrygamat merged commit 5019569 into java-native:master Sep 20, 2021
@pietrygamat pietrygamat deleted the maven-autorelease branch September 20, 2021 19:45
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.

1 participant