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

Use sbt-ci-release & setup release/publish workflow #332

Merged
merged 3 commits into from
Nov 20, 2023
Merged

Use sbt-ci-release & setup release/publish workflow #332

merged 3 commits into from
Nov 20, 2023

Conversation

gaeljw
Copy link
Collaborator

@gaeljw gaeljw commented Nov 18, 2023

Aims to resolve #328


I removed the usage of sbt-release in favour of sbt-ci-release which brings a simpler setup with default settings that should be okay for us.

  • sbt-ci-release eliminates the need for sbt-pgp and sbt-sonatype as well
  • sbt-ci-release brings in sbt-dynver which dynamically sets a version from git tags and eliminates the need to maintain the version.sbt file

Then I used sbt-github-actions to generate the GH Workflows to handle publishing/releasing.

_To be noted that I'm not a big fan of the workflows it generates and would have preferred to set up the workflows myself in two distinct files for instance. Also I don't get why it generates download/inflate steps. But as it was already used, let's keep using it for now, at least you don't have to trust me for the workflows as they are generated 😅 _


Once this is merged, this means that to release the project we'll only have to push a tag named 'v...' to the repository.

Pushing/merging to master branch will also generates a publish for a SNAPSHOT version to Sonatype staging repository.


Also included in this PR but slightly unrelated: I explicitly set the scala version to be 2.13 rather than 2.12 (default), otherwise some tools (like IntelliJ) refuses to import the project.


Next steps:

  • someone with admin rights need to enter the 4 secrets needed by the workflow in the project secrets:
    • PGP_PASSPHRASE: Can we reuse the one you used for last release @avdv ? Or I can generate a new one.
    • PGP_SECRET: same here
    • SONATYPE_PASSWORD: password part of the token to Sonatype. I guess you have one @avdv? Or you can generate a new one if you prefer to.
    • SONATYPE_USERNAME: username part of the token to Sonatype. same here.
  • Merge this to master, check that a snapshot is published to Sonatype staging
  • Optionally, create a tag v2.9.1 to check the release publishing

The sbt-ci-release README should explain most of it if anything is unclear.

@avdv
Copy link
Collaborator

avdv commented Nov 20, 2023

@gaeljw Very nice!

Next steps:

* someone with admin rights need to enter the 4 secrets needed by the workflow in the project secrets:
  
  * `PGP_PASSPHRASE`: Can we reuse the one you used for last release @avdv ? Or I can generate a new one.
  * `PGP_SECRET`: same here
  * `SONATYPE_PASSWORD`: password part of the token to Sonatype. I guess you have one @avdv? Or you can generate a new one if you prefer to.
  * `SONATYPE_USERNAME`: username part of the token to Sonatype. same here.

Done. Note that the GPG key expires 2025-11-15. At that time you can probably add a new one.

* Merge this to master, check that a snapshot is published to Sonatype staging

Let's try 🚀

Otherwise, Scala 2.12 is used by default when running sbt compile or importing project in IntelliJ for instance.
@avdv avdv merged commit 25a0daf into master Nov 20, 2023
7 checks passed
@avdv avdv deleted the gh328 branch November 20, 2023 20:28
@gaeljw
Copy link
Collaborator Author

gaeljw commented Nov 21, 2023

I allowed myself to create a tag v2.9.1 to test a "real" release.

It failed with:

error [Sonatype] [MISSING_PROFILE] Profile de.leanovate.play-mockws is not found. Check your sonatypeProfileName setting in build.sbt

Sounds related to a setting I removed by mistake:

sonatypeProfileName := "de.leanovate"

I'll work on fixing this today.

@gaeljw
Copy link
Collaborator Author

gaeljw commented Nov 21, 2023

After a few other fixes, it's now working fine for releases. We should see a 2.9.4 in Maven Central in a few hours.

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.

Automate release with Github Actions
2 participants