-
Notifications
You must be signed in to change notification settings - Fork 4
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
Adopt GHA Scala Library Release Workflow #1223
Conversation
4c79c4a
to
328aec8
Compare
328aec8
to
1af8f71
Compare
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! Thanks for doing this @aracho1!
cc @davidfurey - this should help with one of your changes, right?
releaseProcess := Seq[ReleaseStep]( | ||
checkSnapshotDependencies, | ||
inquireVersions, | ||
runClean, | ||
runTest, | ||
setReleaseVersion, | ||
commitReleaseVersion, | ||
tagRelease, | ||
setNextVersion, | ||
commitNextVersion | ||
) |
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.
A bit unusually, there's no 'root' project in this build, and I think that settings at the top-level are automatically part of a 'default root'? So this should be a good place to put the release settings.
import play.sbt.PlayImport.specs2 | ||
import sbt.Keys.{libraryDependencies, mainClass} | ||
import sbtassembly.AssemblyPlugin.autoImport.{assemblyJarName, assemblyMergeStrategy} | ||
import sbtassembly.MergeStrategy | ||
import com.typesafe.sbt.packager.docker.{Cmd, ExecCmd} | ||
|
||
val projectVersion = "1.0-latest" | ||
|
||
organization := "com.gu" | ||
ThisBuild / publish / skip := 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.
This repo has any projects, and almost all of them we don't want to publish to Maven Central, so unusually for [gha-scala-library-release-workflow](https://github.com/guardian/gha-scala-library-release-workflow)
we make publish / skip := true
the default - and then set it in api-models
below.
@@ -203,6 +218,7 @@ lazy val apiModels = { | |||
import ReleaseStateTransformations._ | |||
Project("api-models", file("api-models")).settings(Seq( | |||
name := "mobile-notifications-api-models", | |||
publish / skip := false, |
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.
This is unusual, but we've made publish / skip := true
the default in this project as so many projects are not ones we want to publish.
After a couple of tweaks: ...the release has succeeded with v1.0.18 🎉 https://index.scala-lang.org/guardian/mobile-n10n/artifacts/mobile-notifications-api-models/1.0.18 https://repo1.maven.org/maven2/com/gu/mobile-notifications-api-models_2.13/1.0.18/ |
Thanks Ara and Roberto, this is really helpful. It unblocks us upgrading the fronts tool to Play 3.0 |
This replaces the old release process which had developers manually running sbt release on their own laptops - each developer had to obtain their own PGP key and Sonatype credentials, which was an elaborate & fiddly process.
This PR adopts gha-scala-library-release-workflow, which provides an automated release process that uses single shared set of release credentials, available through GitHub Organisation Secrets (like we already do with NPM) - this workflow allows you to release a new library version with the click of a button!
Most of the changes made here are documented in gha-scala-library-release-workflow's configuration.md.
We've granted access to release credentials via this PR.