Skip to content

Commit

Permalink
Merge pull request #14 from dwickern/release
Browse files Browse the repository at this point in the history
Set up sbt-ci-release
  • Loading branch information
dwickern authored Nov 6, 2023
2 parents 227810a + 91e2671 commit a358dc7
Show file tree
Hide file tree
Showing 6 changed files with 59 additions and 47 deletions.
4 changes: 4 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
template: |
## What’s Changed
$CHANGES
22 changes: 22 additions & 0 deletions .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Release Drafter

on:
push:
branches:
- master

permissions:
contents: read

jobs:
update_release_draft:
permissions:
contents: write
pull-requests: read
runs-on: ubuntu-latest
steps:
- uses: release-drafter/release-drafter@v5
with:
disable-autolabeler: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
23 changes: 23 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Release
on:
push:
branches: [master, main]
tags: ["*"]
jobs:
publish:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 8
cache: sbt
- run: sbt ci-release
env:
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
PGP_SECRET: ${{ secrets.PGP_SECRET }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
52 changes: 9 additions & 43 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ lazy val plugin = (projectMatrix in file("sbt-plugin"))
autoScalaLibrary = false,
axisValues = Seq(VirtualAxis.jvm),
_.enablePlugins(BuildInfoPlugin).settings(
publishSettings,
name := "sbt-swagger-play",
sbtPlugin := true,
addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.7.9" % Provided),
Expand Down Expand Up @@ -68,7 +67,6 @@ lazy val pluginTests = plugin

lazy val testPlugin = (project in file("test-plugin"))
.settings(
publishSettings,
name := "sbt-swagger-play-testkit",
sbtPlugin := true,
libraryDependencies += "com.typesafe.play" %% "play-json" % "2.9.2",
Expand All @@ -78,7 +76,6 @@ lazy val testPlugin = (project in file("test-plugin"))

lazy val runner = (projectMatrix in file("runner"))
.settings(
publishSettings,
name := "sbt-swagger-play-runner",
libraryDependencies ++= Seq(
"org.scalatest" %% "scalatest" % "3.2.17" % Test,
Expand Down Expand Up @@ -147,44 +144,13 @@ lazy val runner = (projectMatrix in file("runner"))
)
)

lazy val publishSettings = Seq(
publishTo := sonatypePublishToBundle.value,
releaseCrossBuild := true,
pomExtra := {
<url>https://github.com/dwickern/sbt-swagger-play</url>
<licenses>
<license>
<name>MIT</name>
<url>https://raw.githubusercontent.com/dwickern/sbt-swagger-play/master/LICENSE</url>
<distribution>repo</distribution>
</license>
</licenses>
<scm>
<url>git@github.com:dwickern/sbt-swagger-play.git</url>
<connection>scm:git:git@github.com:dwickern/sbt-swagger-play.git</connection>
</scm>
<developers>
<developer>
<id>dwickern</id>
<name>Derek Wickern</name>
<url>dwickern@gmail.com</url>
</developer>
</developers>
}
)

import sbtrelease.ReleasePlugin.autoImport.ReleaseTransformations._

releaseProcess := Seq[ReleaseStep](
checkSnapshotDependencies,
inquireVersions,
runClean,
runTest,
setReleaseVersion,
commitReleaseVersion,
tagRelease,
releaseStepCommandAndRemaining("+publishSigned"),
releaseStepCommand("sonatypeBundleRelease"),
setNextVersion,
commitNextVersion,
ThisBuild / homepage := scmInfo.value.map(_.browseUrl)
ThisBuild / licenses := Seq(License.MIT)
ThisBuild / developers := List(
Developer(
id = "dwickern",
name = "Derek Wickern",
email = "dwickern@gmail.com",
url = url("https://github.com/dwickern")
)
)
4 changes: 1 addition & 3 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
addSbtPlugin("com.eed3si9n" % "sbt-projectmatrix" % "0.7.0")
addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.10.0")
addSbtPlugin("com.github.gseitz" % "sbt-release" % "1.0.13")
addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "3.9.5")
addSbtPlugin("com.jsuereth" % "sbt-pgp" % "2.0.2")
addSbtPlugin("org.jetbrains" % "sbt-ide-settings" % "1.1.0")
addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.5.12")

libraryDependencies += "org.scala-sbt" %% "scripted-plugin" % sbtVersion.value
1 change: 0 additions & 1 deletion version.sbt

This file was deleted.

0 comments on commit a358dc7

Please sign in to comment.