Skip to content

Commit

Permalink
Merge pull request #79 from guardian/ts/add-scala-release-workflow
Browse files Browse the repository at this point in the history
feat: add Scala release workflow
  • Loading branch information
tjsilver authored Mar 13, 2024
2 parents 044677c + 1693e72 commit 9886fe9
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 40 deletions.
13 changes: 13 additions & 0 deletions .github/workflows/release.yml
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, 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 }}
56 changes: 17 additions & 39 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,55 +1,21 @@
import ReleaseTransformations._
import sbtversionpolicy.withsbtrelease.ReleaseVersion

name := "simple-configuration"

ThisBuild / scmInfo := Some(
ScmInfo(
url("https://github.com/guardian/simple-configuration"),
"scm:git@github.com:guardian/simple-configuration.git"
)
)

ThisBuild / homepage := Some(url("https://github.com/guardian/simple-configuration"))

ThisBuild / developers := List(Developer(
id = "Guardian",
name = "Guardian",
email = null,
url = url("https://github.com/guardian")
))

val scala_2_12: String = "2.12.19"
val scala_2_13: String = "2.13.13"

val awsSdkVersion = "2.23.21"

scalaVersion := scala_2_13

ThisBuild / publishTo := sonatypePublishTo.value

val sharedSettings = Seq(
scalaVersion := scala_2_13,
crossScalaVersions := Seq(scala_2_12, scala_2_13),
releaseCrossBuild := true,
licenses += ("Apache-2.0", url(
"http://www.apache.org/licenses/LICENSE-2.0.html"
)),
licenses := Seq(License.Apache2),
organization := "com.gu",
releasePublishArtifactsAction := PgpKeys.publishSigned.value,
releaseProcess := Seq[ReleaseStep](
checkSnapshotDependencies,
inquireVersions,
runClean,
runTest,
setReleaseVersion,
commitReleaseVersion,
tagRelease,
releaseStepCommandAndRemaining("+publishSigned"),
releaseStepCommand("sonatypeBundleRelease"),
setNextVersion,
commitNextVersion,
pushChanges
)
scalacOptions := Seq("-release:11")
)

val core = project
Expand Down Expand Up @@ -86,7 +52,19 @@ lazy val root = project
.in(file("."))
.aggregate(core, s3, ssm)
.settings(
publish := {},
publish / skip := true,
releaseCrossBuild := true,
crossScalaVersions := Seq(scala_2_12, scala_2_13)
releaseProcess := Seq[ReleaseStep](
checkSnapshotDependencies,
inquireVersions,
runClean,
runTest,
setReleaseVersion,
commitReleaseVersion,
tagRelease,
setNextVersion,
commitNextVersion
),
crossScalaVersions := Seq(scala_2_12, scala_2_13),
releaseVersion := ReleaseVersion.fromAggregatedAssessedCompatibilityWithLatestRelease().value
)
2 changes: 1 addition & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ addSbtPlugin("com.github.sbt" % "sbt-release" % "1.4.0")

addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "3.10.0")

addSbtPlugin("com.github.sbt" % "sbt-pgp" % "2.2.1")
addSbtPlugin("ch.epfl.scala" % "sbt-version-policy" % "3.2.0")

0 comments on commit 9886fe9

Please sign in to comment.