-
Notifications
You must be signed in to change notification settings - Fork 1
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 #299
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
name: Release | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
release: | ||
uses: guardian/gha-scala-library-release-workflow/.github/workflows/reusable-release.yml@main | ||
permissions: | ||
contents: write | ||
secrets: | ||
AUTOMATED_MAVEN_RELEASE_PGP_SECRET: ${{ secrets.AUTOMATED_MAVEN_RELEASE_PGP_SECRET }} | ||
AUTOMATED_MAVEN_RELEASE_SONATYPE_PASSWORD: ${{ secrets.AUTOMATED_MAVEN_RELEASE_SONATYPE_PASSWORD }} | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
import Dependencies._ | ||
import sbtrelease.ReleaseStateTransformations._ | ||
import sbtversionpolicy.withsbtrelease.ReleaseVersion.fromAggregatedAssessedCompatibilityWithLatestRelease | ||
|
||
organization := "com.gu" | ||
|
||
|
@@ -8,41 +9,18 @@ name := "facia-api-client" | |
description := "Scala client for The Guardian's Facia JSON API" | ||
|
||
val sonatypeReleaseSettings = Seq( | ||
licenses := Seq("Apache V2" -> url("http://www.apache.org/licenses/LICENSE-2.0.html")), | ||
scmInfo := Some(ScmInfo( | ||
url("https://github.com/guardian/facia-scala-client"), | ||
"scm:git:[email protected]:guardian/facia-scala-client.git" | ||
)), | ||
pomExtra := ( | ||
<url>https://github.com/guardian/facia-scala-client</url> | ||
<developers> | ||
<developer> | ||
<id>janua</id> | ||
<name>Francis Carr</name> | ||
<url>https://github.com/janua</url> | ||
</developer> | ||
<developer> | ||
<id>adamnfish</id> | ||
<name>Adam Fisher</name> | ||
<url>https://github.com/adamnfish</url> | ||
</developer> | ||
</developers> | ||
), | ||
Comment on lines
-12
to
-30
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. All the required metadata deleted here is now provided by |
||
licenses := Seq("Apache V2" -> url("https://www.apache.org/licenses/LICENSE-2.0.html")), | ||
releaseVersion := fromAggregatedAssessedCompatibilityWithLatestRelease().value, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
This means that sbt 1.5.0 and above will be able to tell when incompatible versions of this library are being used in a project. |
||
releaseCrossBuild := true, // true if you cross-build the project for multiple Scala versions | ||
releaseProcess := Seq[ReleaseStep]( | ||
checkSnapshotDependencies, | ||
inquireVersions, | ||
runClean, | ||
runTest, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is a bit unusual, the other 3 repos that that have adopted I have a couple of ideas on how to solve this, but would like to address it in a subsequent PR. |
||
setReleaseVersion, | ||
commitReleaseVersion, | ||
tagRelease, | ||
// For non cross-build projects, use releaseStepCommand("publishSigned") | ||
releaseStepCommandAndRemaining("+publishSigned"), | ||
releaseStepCommand("sonatypeBundleRelease"), | ||
Comment on lines
-41
to
-42
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For projects using This means we can remove |
||
setNextVersion, | ||
commitNextVersion, | ||
pushChanges | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For projects using |
||
commitNextVersion | ||
) | ||
) | ||
|
||
|
@@ -52,7 +30,6 @@ lazy val root = (project in file(".")).aggregate( | |
fapiClient_play27, | ||
fapiClient_play28 | ||
).settings( | ||
publishArtifact := false, | ||
publish / skip := true, | ||
Comment on lines
-55
to
33
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
sonatypeReleaseSettings | ||
) | ||
|
@@ -70,12 +47,12 @@ def baseProject(module: String, majorMinorVersion: String) = Project(s"$module-p | |
scalaVersion := "2.13.11", | ||
crossScalaVersions := Seq(scalaVersion.value, "2.12.18"), | ||
scalacOptions := Seq( | ||
"-release:11", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
"-feature", | ||
"-deprecation", | ||
"-Xfatal-warnings" | ||
), | ||
libraryDependencies += scalaTest, | ||
publishTo := sonatypePublishToBundle.value, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
sonatypeReleaseSettings | ||
) | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
sbt.version=1.9.3 | ||
sbt.version=1.9.7 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
addSbtPlugin("com.github.sbt" % "sbt-release" % "1.1.0") | ||
|
||
addSbtPlugin("com.github.sbt" % "sbt-pgp" % "2.2.1") | ||
addSbtPlugin("ch.epfl.scala" % "sbt-version-policy" % "3.2.0") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We don't need the releaseVersion := fromAggregatedAssessedCompatibilityWithLatestRelease().value Note also that our project automatically has |
||
|
||
addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "3.9.21") | ||
|
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.
These GitHub Organisation Secrets will be granted to this repo by https://github.com/guardian/github-secret-access/pull/21.