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

Adopt GHA Scala Library Release Workflow #1223

Merged
merged 1 commit into from
May 1, 2024

Conversation

aracho1
Copy link
Contributor

@aracho1 aracho1 commented May 1, 2024

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.

@aracho1 aracho1 force-pushed the add-gha-scala-library-release-workflow branch from 4c79c4a to 328aec8 Compare May 1, 2024 11:06
@aracho1 aracho1 changed the title first commit - wip Adopt GHA Scala Library Release Workflow May 1, 2024
@aracho1 aracho1 marked this pull request as ready for review May 1, 2024 11:09
@aracho1 aracho1 requested a review from a team as a code owner May 1, 2024 11:09
@aracho1 aracho1 requested a review from rtyley May 1, 2024 11:10
@aracho1 aracho1 force-pushed the add-gha-scala-library-release-workflow branch from 328aec8 to 1af8f71 Compare May 1, 2024 11:12
Copy link
Member

@rtyley rtyley left a 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?

Comment on lines +13 to +23
releaseProcess := Seq[ReleaseStep](
checkSnapshotDependencies,
inquireVersions,
runClean,
runTest,
setReleaseVersion,
commitReleaseVersion,
tagRelease,
setNextVersion,
commitNextVersion
)
Copy link
Member

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
Copy link
Member

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,
Copy link
Member

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.

@aracho1 aracho1 merged commit e715b58 into main May 1, 2024
11 checks passed
@aracho1 aracho1 deleted the add-gha-scala-library-release-workflow branch May 1, 2024 11:18
@rtyley rtyley mentioned this pull request May 1, 2024
@davidfurey
Copy link
Member

Looks great! Thanks for doing this @aracho1!

cc @davidfurey - this should help with one of your changes, right?

Thanks Ara and Roberto, this is really helpful. It unblocks us upgrading the fronts tool to Play 3.0

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

3 participants