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

Setup release through sbt-github-actions and sbt-ci-release #431

Conversation

mdedetrich
Copy link
Contributor

@mdedetrich mdedetrich commented Mar 7, 2023

This PR sets up the project so that to make a proper release you only need to push a tag (i.e. for the next release you would push a tag named v2.4.2) and everything else is handled, i.e. a github action will trigger that will build and publish the entire project using JDK 1.8. Additionally snapshots will also be made whenever a PR is merged to master.

One thing that works slightly differently is the version. As you may have noticed version.sbt is deleted, this is because sbt-ci-release uses sbt-dynver to generate the version of the project automatically via git tags. In more detail, if the current git status is as at a tag you will get the full version (i.e. v2.4.1) however if your current git status is not at a tag then sbt-dynver will automatically create a snapshot version based on the current git commit hash while using the last git tag as the base version, i.e. here is an example

[info] examples / version
[info] 	2.4.1+46-c2978b94-SNAPSHOT
[info] parboiledJVM / version
[info] 	2.4.1+46-c2978b94-SNAPSHOT
[info] jsonBenchmark / Jmh / version
[info] 	1.36
[info] parboiledNative / version
[info] 	2.4.1+46-c2978b94-SNAPSHOT
[info] parboiledCoreJS / version
[info] 	2.4.1+46-c2978b94-SNAPSHOT
[info] parboiledJS / version
[info] 	2.4.1+46-c2978b94-SNAPSHOT
[info] parboiledCoreNative / version
[info] 	2.4.1+46-c2978b94-SNAPSHOT
[info] parboiledCoreJVM / version
[info] 	2.4.1+46-c2978b94-SNAPSHOT
[info] version
[info] 	2.4.1+46-c2978b94-SNAPSHOT

The only thing you need to do is to add all of the sonatype/PGP related details as github secrets, see https://github.com/sbt/sbt-ci-release#secrets for a comprehensive guide. If you add the github secrets before merging this PR then you can confirm that release will work as it will trigger a snapshot release.

matrix:
os: [ubuntu-latest]
scala: [3.2.2]
java: [temurin@8]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Incase its not clear, this determines the JDK version when making a release (which in this case is JDK 8)

Copy link
Owner

Choose a reason for hiding this comment

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

Thank you!

@sirthias
Copy link
Owner

sirthias commented Mar 7, 2023

Ok, you got me.
I just added the repository secrets as described by https://github.com/sbt/sbt-ci-release#secrets.
Let's see, how this works...

@sirthias sirthias merged commit 707d5c5 into sirthias:master Mar 7, 2023
@sirthias
Copy link
Owner

sirthias commented Mar 7, 2023

Thank you, Matthew, once again for the top-notch description of everything around this PR!

@mdedetrich mdedetrich deleted the setup-release-trhough-sbt-github-actions branch March 7, 2023 14:22
@mdedetrich
Copy link
Contributor Author

Thank you, Matthew, once again for the top-notch description of everything around this PR!

No worries

I just checked the publish action at https://github.com/sirthias/parboiled2/actions/runs/4354999485/jobs/7611152727 and it failed with a gpg signing error.

Did you by any chance to forget to Base64 your PGP secret?

@sirthias
Copy link
Owner

sirthias commented Mar 7, 2023

Hmm... nope.
I just ran the shell commands as quoted on https://github.com/sbt/sbt-ci-release#secrets.
The GPG error is

[info] gpg: signing failed: Inappropriate ioctl for device

Looks weird....

@mdedetrich
Copy link
Contributor Author

So I think this is relevant sbt/sbt-ci-release#95

@sirthias
Copy link
Owner

sirthias commented Mar 7, 2023

I'll try again....

@mdedetrich
Copy link
Contributor Author

I found the issue, there is an ancient version of sbt-gpg still in project/plugins.sbt, opening PR.

@sirthias
Copy link
Owner

@mdedetrich Something went wrong here, apparently in the later stages of the release process:
https://github.com/sirthias/parboiled2/actions/runs/5066297397/jobs/9096337824#step:14:388

Do you have any idea as to the cause?

@mdedetrich
Copy link
Contributor Author

This seems to be it xerial/sbt-sonatype#103 (comment). Ill create a PR, in the meantime can you delete the tag on master?

@sirthias
Copy link
Owner

Ah, good, thank you!
I'll delete the tag...

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.

None yet

2 participants