-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adopt GHA Scala Library Release Workflow
Here we're switching from using `actions-sbt-release` to `gha-scala-library-release-workflow` for publishing releases of this library - see also guardian/actions-sbt-release#1. A fair bit of sbt configuration is deleted or changed - see the docs on config changes for more information: https://github.com/guardian/gha-scala-library-release-workflow/blob/main/docs/configuration.md Once this PR is merged, we should also delete the old repository secrets: https://github.com/guardian/atom-maker/settings/secrets/actions
- Loading branch information
Showing
6 changed files
with
44 additions
and
82 deletions.
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 |
---|---|---|
@@ -1,15 +1,12 @@ | ||
name: 'Publish Release' | ||
name: Release | ||
|
||
on: | ||
release: | ||
types: [published] | ||
workflow_dispatch: | ||
|
||
jobs: | ||
sbt_release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: guardian/actions-sbt-release@v3 | ||
with: | ||
pgpSecret: ${{ secrets.PGP_SECRET }} | ||
pgpPassphrase: ${{ secrets.PGP_PASSPHRASE }} | ||
sonatypeUsername: ${{ secrets.SONATYPE_USERNAME }} | ||
sonatypePassword: ${{ secrets.SONATYPE_PASSWORD }} | ||
isSnapshot: ${{ github.event.release.prerelease }} | ||
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 }} |
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,65 +1,47 @@ | ||
import sbtrelease._ | ||
import ReleaseStateTransformations._ | ||
|
||
import ReleaseStateTransformations.* | ||
import sbtversionpolicy.withsbtrelease.ReleaseVersion | ||
|
||
name := "atom-maker-lib" | ||
|
||
lazy val baseSettings = Seq( | ||
lazy val artifactProductionSettings = Seq( | ||
organization := "com.gu", | ||
scalaVersion := "2.12.17", | ||
crossScalaVersions := Seq(scalaVersion.value, "2.13.10"), | ||
licenses := Seq("Apache V2" -> url("https://www.apache.org/licenses/LICENSE-2.0.html")), | ||
scmInfo := Some(ScmInfo(url("https://github.com/guardian/atom-maker"), | ||
"scm:git:[email protected]:guardian/atom-maker.git")), | ||
scalacOptions := Seq("-deprecation", "-feature"), | ||
publishTo := sonatypePublishToBundle.value, | ||
scalaVersion := "2.12.18", | ||
crossScalaVersions := Seq(scalaVersion.value, "2.13.12"), | ||
licenses := Seq(License.Apache2), | ||
scalacOptions := Seq("-deprecation", "-feature", "-release:8") | ||
) | ||
|
||
lazy val atomPublisher = (project in file("./atom-publisher-lib")) | ||
.settings(baseSettings: _*) | ||
.settings( | ||
organization := "com.gu", | ||
name := "atom-publisher-lib" | ||
name := "atom-publisher-lib", | ||
Test / publishArtifact := true, | ||
artifactProductionSettings | ||
) | ||
.settings(Test / publishArtifact := true) | ||
|
||
|
||
lazy val atomManagerPlay = (project in file("./atom-manager-play-lib")) | ||
.settings(baseSettings: _*) | ||
.dependsOn(atomPublisher % "test->test;compile->compile") | ||
.settings( | ||
organization := "com.gu", | ||
name := "atom-manager-play-lib" | ||
name := "atom-manager-play-lib", | ||
Test / publishArtifact := true, | ||
artifactProductionSettings | ||
) | ||
.settings(Test / publishArtifact := true) | ||
.dependsOn(atomPublisher % "test->test;compile->compile") | ||
|
||
lazy val commonReleaseProcess = Seq[ReleaseStep]( | ||
checkSnapshotDependencies, | ||
inquireVersions, | ||
setReleaseVersion, | ||
runClean, | ||
runTest, | ||
// For non cross-build projects, use releaseStepCommand("publishSigned") | ||
releaseStepCommandAndRemaining("+publishSigned"), | ||
) | ||
|
||
lazy val productionReleaseProcess = commonReleaseProcess ++ Seq[ReleaseStep]( | ||
releaseStepCommand("sonatypeBundleRelease"), | ||
) | ||
|
||
lazy val snapshotReleaseProcess = commonReleaseProcess | ||
|
||
lazy val atomLibraries = (project in file(".")) | ||
.aggregate(atomPublisher, atomManagerPlay) | ||
.settings(baseSettings: _*).settings( | ||
publishArtifact := false, | ||
publish := {}, | ||
publishLocal := {}, | ||
releaseCrossBuild := true, // true if you cross-build the project for multiple Scala versions | ||
releaseProcess := { | ||
sys.props.get("RELEASE_TYPE") match { | ||
case Some("production") => productionReleaseProcess | ||
case _ => snapshotReleaseProcess | ||
} | ||
} | ||
) | ||
.aggregate(atomPublisher, atomManagerPlay).settings( | ||
publish / skip := true, | ||
releaseVersion := ReleaseVersion.fromAggregatedAssessedCompatibilityWithLatestRelease().value, | ||
releaseCrossBuild := true, // true if you cross-build the project for multiple Scala versions | ||
releaseProcess := Seq[ReleaseStep]( | ||
checkSnapshotDependencies, | ||
inquireVersions, | ||
runClean, | ||
runTest, | ||
setReleaseVersion, | ||
commitReleaseVersion, | ||
tagRelease, | ||
setNextVersion, | ||
commitNextVersion | ||
) | ||
) |
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 +1 @@ | ||
sbt.version=1.8.0 | ||
sbt.version=1.9.8 |
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
This file was deleted.
Oops, something went wrong.
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 @@ | ||
ThisBuild / version := "1.4.1-SNAPSHOT" |