diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..9286236 --- /dev/null +++ b/.github/workflows/release.yml @@ -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_TOKEN: ${{ secrets.AUTOMATED_MAVEN_RELEASE_SONATYPE_TOKEN }} + PGP_PRIVATE_KEY: ${{ secrets.AUTOMATED_MAVEN_RELEASE_PGP_SECRET }} + GITHUB_APP_PRIVATE_KEY: ${{ secrets.AUTOMATED_MAVEN_RELEASE_GITHUB_APP_PRIVATE_KEY }} \ No newline at end of file diff --git a/.tool-versions b/.tool-versions new file mode 100644 index 0000000..ef1b7a1 --- /dev/null +++ b/.tool-versions @@ -0,0 +1,2 @@ +java corretto-21.0.3.9.1 + diff --git a/build.sbt b/build.sbt index 2f547d8..335b69b 100755 --- a/build.sbt +++ b/build.sbt @@ -1,3 +1,4 @@ +import sbtversionpolicy.withsbtrelease.ReleaseVersion.fromAggregatedAssessedCompatibilityWithLatestRelease name := "fastly-api-client" @@ -17,7 +18,7 @@ libraryDependencies ++= Seq( "com.typesafe" % "config" % "1.4.3" % Test ) -ThisBuild / scalacOptions ++= Seq("-deprecation", "-feature", "-language:postfixOps", "-release", "11") ++ +scalacOptions ++= Seq("-deprecation", "-feature", "-language:postfixOps", "-release:11") ++ (CrossVersion.partialVersion(scalaVersion.value) match { case Some((2, _)) => Seq("-Xsource:3") // flags only needed in Scala 2 case _ => Seq.empty @@ -27,39 +28,10 @@ enablePlugins(BuildInfoPlugin) buildInfoKeys := Seq[BuildInfoKey](name, version) buildInfoPackage := "com.gu.fastly.api" -publishMavenStyle := true - -publishTo := sonatypePublishToBundle.value - -Test / publishArtifact := false - -pomIncludeRepository := { _ => false } - -pomExtra := ( - https://github.com/guardian/fastly-api-client - - - Apache License, Version 2.0 - http://www.apache.org/licenses/LICENSE-2.0.html - repo - - - - git@github.com:guardian/fastly-api-client.git - scm:git:git@github.com:guardian/fastly-api-client.git - - - - obrienm - Matthew O'Brien - http://www.theguardian.com - - -) - - import ReleaseTransformations._ +licenses := Seq(License.Apache2) +releaseVersion := fromAggregatedAssessedCompatibilityWithLatestRelease().value releaseCrossBuild := true releaseProcess := Seq[ReleaseStep]( @@ -70,10 +42,6 @@ releaseProcess := Seq[ReleaseStep]( setReleaseVersion, commitReleaseVersion, tagRelease, - // For non cross-build projects, use releaseStepCommand("publishSigned") - releaseStepCommandAndRemaining("+publishSigned"), - releaseStepCommand("sonatypeBundleRelease"), setNextVersion, commitNextVersion, - pushChanges ) diff --git a/project/plugins.sbt b/project/plugins.sbt index 677b9e5..129b443 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -2,6 +2,6 @@ addSbtPlugin("com.github.sbt" % "sbt-release" % "1.4.0") addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "3.11.0") -addSbtPlugin("com.github.sbt" % "sbt-pgp" % "2.2.1") - addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.12.0") + +addSbtPlugin("ch.epfl.scala" % "sbt-version-policy" % "3.2.1") \ No newline at end of file