Skip to content

Commit

Permalink
WIP: Adopt scala library release GHA workflow
Browse files Browse the repository at this point in the history
Following [the example from
play-secret-rotation](guardian/play-secret-rotation#416),
rather than set up a new developer credential to release the next
version of this library, this commit sets up
[guardian/gha-scala-library-release-workflow](https://github.com/guardian/gha-scala-library-release-workflow).
  • Loading branch information
emdash-ie committed Dec 14, 2023
1 parent d00f4d6 commit 9be3aec
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 14 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
secrets:
AUTOMATED_MAVEN_RELEASE_PGP_SECRET: ${{ secrets.AUTOMATED_MAVEN_RELEASE_PGP_SECRET }}
AUTOMATED_MAVEN_RELEASE_SONATYPE_PASSWORD: ${{ secrets.AUTOMATED_MAVEN_RELEASE_SONATYPE_PASSWORD }}
14 changes: 5 additions & 9 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import sbtversionpolicy.withsbtrelease.ReleaseVersion.fromAggregatedAssessedCompatibilityWithLatestRelease

ThisBuild/scalaVersion := "2.13.12"

ThisBuild/crossScalaVersions := Seq(scalaVersion.value)
Expand All @@ -6,6 +8,7 @@ val commonSettings = Seq(
organization := "com.gu",
homepage := Some(url("https://github.com/guardian/marley")),
licenses := Seq("Apache V2" -> url("http://www.apache.org/licenses/LICENSE-2.0.html")),
releaseVersion := fromAggregatedAssessedCompatibilityWithLatestRelease().value,
libraryDependencies ++= Seq(
"org.scala-lang" % "scala-reflect" % scalaVersion.value,
"com.twitter" %% "scrooge-core" % "22.12.0",
Expand Down Expand Up @@ -42,9 +45,7 @@ Test/publishArtifact := false

lazy val root = (project in file(".")).aggregate(core).settings(
update/aggregate := false,
publishArtifact := false,
publish := {},
publishLocal := {}
publish/skip := true,
)

import ReleaseTransformations._
Expand All @@ -60,11 +61,6 @@ releaseProcess := Seq[ReleaseStep](
setReleaseVersion,
commitReleaseVersion,
tagRelease,
// For non cross-build projects, use releaseStepCommand("publishSigned")
releaseStepCommandAndRemaining("+publishSigned"),
releaseStepCommand("sonatypeBundleRelease"),
setNextVersion,
commitNextVersion,
pushChanges
commitNextVersion
)

2 changes: 1 addition & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ libraryDependencies += "org.apache.thrift" % "libthrift" % "0.17.0"
addSbtPlugin("com.twitter" %% "scrooge-sbt-plugin" % "22.12.0")

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")
addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "3.9.21")
4 changes: 0 additions & 4 deletions sonatype.sbt
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
publishMavenStyle := true

sonatypeProfileName := "com.gu"

ThisBuild / publishTo := sonatypePublishToBundle.value

ThisBuild / scmInfo := Some(ScmInfo(
url("https://github.com/guardian/marley"),
"scm:git:git@github.com:guardian/marley.git"
Expand Down

0 comments on commit 9be3aec

Please sign in to comment.