-
Notifications
You must be signed in to change notification settings - Fork 0
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
Update build and include sbt publish GHA workflow #193
Merged
Merged
Changes from 2 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
2eb649a
Update build and include sbt publish GH workflow
adamnfish e97c536
Tidy up licence definition
adamnfish 37e1b0c
Rename release workflow to match other repositories
adamnfish a567ecf
Update README to describe the new sbt release process
adamnfish 57e67b4
Update README.md
adamnfish File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
name: Release Scala client | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
release: | ||
uses: guardian/gha-scala-library-release-workflow/.github/workflows/reusable-release.yml@main | ||
permissions: { contents: write, pull-requests: write } | ||
secrets: | ||
SONATYPE_PASSWORD: ${{ secrets.AUTOMATED_MAVEN_RELEASE_SONATYPE_PASSWORD }} | ||
PGP_PRIVATE_KEY: ${{ secrets.AUTOMATED_MAVEN_RELEASE_PGP_SECRET }} | ||
GITHUB_APP_PRIVATE_KEY: ${{ secrets.AUTOMATED_MAVEN_RELEASE_GITHUB_APP_PRIVATE_KEY }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
import sbtrelease.ReleaseStateTransformations.* | ||
import sbtversionpolicy.withsbtrelease.ReleaseVersion | ||
|
||
val compilerOptions = Seq( | ||
"-deprecation", | ||
"-Xfatal-warnings", | ||
|
@@ -19,21 +22,12 @@ inThisBuild(Seq( | |
scalacOptions ++= Seq( | ||
"-deprecation", | ||
"-Xfatal-warnings", | ||
"-encoding", "UTF-8" | ||
"-encoding", "UTF-8", | ||
"-release:11", | ||
), | ||
// sonatype metadata | ||
organization := "com.gu", | ||
licenses := Seq("Apache V2" -> url("https://www.apache.org/licenses/LICENSE-2.0.html")), | ||
scmInfo := Some( | ||
ScmInfo( | ||
url("https://github.com/guardian/anghammarad"), | ||
"scm:[email protected]:guardian/anghammarad" | ||
) | ||
), | ||
homepage := scmInfo.value.map(_.browseUrl), | ||
developers := List( | ||
Developer(id = "guardian", name = "Guardian", email = null, url = url("https://github.com/guardian")) | ||
) | ||
licenses := Seq(License.Apache2), | ||
)) | ||
|
||
val awsSdkVersion = "1.12.697" | ||
|
@@ -48,20 +42,27 @@ lazy val root = project | |
.in(file(".")) | ||
.settings( | ||
name := "anghammarad-root", | ||
// publish settings | ||
releaseCrossBuild := true, | ||
publish / skip := true, | ||
publishTo := sonatypePublishTo.value, | ||
releaseProcess += releaseStepCommandAndRemaining("sonatypeRelease"), | ||
// publish settings, for common and client | ||
releaseCrossBuild := true, | ||
releaseProcess := Seq[ReleaseStep]( | ||
checkSnapshotDependencies, | ||
inquireVersions, | ||
runClean, | ||
runTest, | ||
setReleaseVersion, | ||
commitReleaseVersion, | ||
tagRelease, | ||
setNextVersion, | ||
commitNextVersion, | ||
), | ||
releaseVersion := ReleaseVersion.fromAggregatedAssessedCompatibilityWithLatestRelease().value, | ||
) | ||
.aggregate(anghammarad, client, common, dev) | ||
|
||
lazy val common = project | ||
.settings( | ||
name := "anghammarad-common", | ||
// publish settings | ||
releasePublishArtifactsAction := PgpKeys.publishSigned.value, | ||
publishTo := sonatypePublishTo.value, | ||
) | ||
|
||
lazy val client = project | ||
|
@@ -74,9 +75,6 @@ lazy val client = project | |
"com.typesafe.scala-logging" %% "scala-logging" % scalaLoggingVersion, | ||
"org.scalatest" %% "scalatest" % scalaTestVersion % Test | ||
), | ||
// publish settings | ||
releasePublishArtifactsAction := PgpKeys.publishSigned.value, | ||
publishTo := sonatypePublishTo.value, | ||
assemblySettings, | ||
) | ||
|
||
|
@@ -104,9 +102,9 @@ lazy val anghammarad = project | |
"ch.qos.logback" % "logback-classic" % "1.5.4", | ||
"org.scalatest" %% "scalatest" % scalaTestVersion % Test | ||
), | ||
publish / skip := true, | ||
assembly / assemblyOutputPath := file("anghammarad/anghammarad.jar"), | ||
assemblySettings, | ||
publish / skip := true, | ||
) | ||
|
||
lazy val dev = project | ||
|
@@ -115,7 +113,7 @@ lazy val dev = project | |
libraryDependencies ++= Seq( | ||
"com.github.scopt" %% "scopt" % "4.1.0" | ||
), | ||
publish / skip := true, | ||
assemblySettings, | ||
publish / skip := true, | ||
) | ||
.dependsOn(common, anghammarad, client) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Just by convention, this file is called
release.yml
in all the other repos that havegha-scala-library-release-workflow
- would it be ok to rename this file to match?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.
The trouble is that this repo has a node client and a Scala client. I didn't want the workflow to give the impression it would do both. Let me know if you feel super strongly, but I don't think hogging the word "release" in the workflow namespace is always a good idea!
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.
That makes sense - what we've actually done with other libraries that publish both NPM & Scala packages is that we've tied them together in a single release workflow (at which point, it's kind of ok to just call it
release.yml
again). We allow the NPM release to utilise the Scala libraries version number, so that their releases are synchronised and it's easy to see whether the NPM and Scala libraries are from the same point in time.We've done this for:
These libraries where largely completely defined by their thrift definitions, so if one library wanted to change, the other did too. This might not be the case with
anghammarad
, so it might not apply here, but it is quite nice to just have one button to press.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.
Ok makes sense! I'll rename it and we can consider unifying these libraries in the future.