Skip to content

Commit

Permalink
use sbt-ci-release. change groupId
Browse files Browse the repository at this point in the history
  • Loading branch information
xuwei-k committed Mar 1, 2021
1 parent 58d92f7 commit ace337c
Show file tree
Hide file tree
Showing 11 changed files with 49 additions and 36 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ jobs:
os: ubuntu-latest
steps:
- uses: actions/checkout@v2.3.4
with:
fetch-depth: 0
- uses: olafurpg/setup-scala@v10
with:
java-version: "adopt@1.${{ matrix.java }}"
Expand Down
21 changes: 21 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Release
on:
push:
branches: [master]
tags: ["*"]
jobs:
publish:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2.3.4
with:
fetch-depth: 0
- uses: olafurpg/setup-scala@v10
- run: sbt ci-release
if: ${{ !github.event.repository.fork }}
env:
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
PGP_SECRET: ${{ secrets.PGP_SECRET }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
CI_RELEASE: "^ publishSigned"
47 changes: 19 additions & 28 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import sbtrelease.ReleaseStateTransformations._

ThisBuild / organization := "com.github.gseitz"
ThisBuild / organization := "com.github.sbt"

lazy val protocJar = "com.github.os72" % "protoc-jar" % "3.11.4"

Expand All @@ -12,38 +10,31 @@ lazy val root = (project in file("."))
libraryDependencies += protocJar
scalacOptions := Seq("-deprecation", "-unchecked", "-Xlint", "-Yno-adapted-args")
(Compile / doc / scalacOptions) ++= {
val tagOrBranch = if(isSnapshot.value) {
sys.process.Process("git rev-parse HEAD").lineStream_!.head
} else {
"v" + version.value
}
val hash = sys.process.Process("git rev-parse HEAD").lineStream_!.head
Seq(
"-sourcepath", baseDirectory.value.getAbsolutePath,
"-doc-source-url", "https://github.com/sbt/sbt-protobuf/blob/" + tagOrBranch + "€{FILE_PATH}.scala"
"-doc-source-url", "https://github.com/sbt/sbt-protobuf/blob/" + hash + "€{FILE_PATH}.scala"
)
}
publishMavenStyle := false
bintrayOrganization := Some("sbt")
bintrayRepository := "sbt-plugin-releases"
bintrayPackage := "sbt-protobuf"
bintrayReleaseOnPublish := false
licenses += (("Apache-2.0", url("https://www.apache.org/licenses/LICENSE-2.0")))
homepage := Some(url("https://github.com/sbt/sbt-protobuf"))
pomExtra := {
<developers>{
Seq(
("xuwei-k", "Kenji Yoshida"),
("eed3si9n", "Eugene Yokota"),
).map { case (id, name) =>
<developer>
<id>{id}</id>
<name>{name}</name>
<url>https://github.com/{id}</url>
</developer>
}
}</developers>
}
scriptedBufferLog := false
scriptedLaunchOpts += s"-Dplugin.version=${version.value}"

// Don't update to 1.3.0 https://github.com/sbt/sbt/issues/5049
crossSbtVersions := Seq("0.13.18", "1.2.8")
releaseProcess := Seq[ReleaseStep](
checkSnapshotDependencies,
inquireVersions,
runClean,
releaseStepCommandAndRemaining("^ test"),
releaseStepCommandAndRemaining("^ scripted"),
setReleaseVersion,
commitReleaseVersion,
tagRelease,
releaseStepCommandAndRemaining("^ publish"),
setNextVersion,
commitNextVersion,
pushChanges
)
})
2 changes: 1 addition & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
addSbtPlugin("org.foundweekends" % "sbt-bintray" % "0.6.1")
addSbtPlugin("com.geirsson" % "sbt-ci-release" % "1.5.5")
addSbtPlugin("com.github.sbt" % "sbt-release" % "1.0.15")
addSbtPlugin("com.eed3si9n" % "sbt-nocomma" % "0.1.0")
2 changes: 1 addition & 1 deletion src/sbt-test/delete/clear-dir/project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
if(pluginVersion == null)
throw new RuntimeException("""|The system property 'plugin.version' is not defined.
|Specify this property using the scriptedLaunchOpts -D.""".stripMargin)
else addSbtPlugin("com.github.gseitz" % "sbt-protobuf" % pluginVersion)
else addSbtPlugin("com.github.sbt" % "sbt-protobuf" % pluginVersion)
}
2 changes: 1 addition & 1 deletion src/sbt-test/delete/single-file/project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
if(pluginVersion == null)
throw new RuntimeException("""|The system property 'plugin.version' is not defined.
|Specify this property using the scriptedLaunchOpts -D.""".stripMargin)
else addSbtPlugin("com.github.gseitz" % "sbt-protobuf" % pluginVersion)
else addSbtPlugin("com.github.sbt" % "sbt-protobuf" % pluginVersion)
}
2 changes: 1 addition & 1 deletion src/sbt-test/sbt-protobuf/basic/project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
if(pluginVersion == null)
throw new RuntimeException("""|The system property 'plugin.version' is not defined.
|Specify this property using the scriptedLaunchOpts -D.""".stripMargin)
else addSbtPlugin("com.github.gseitz" % "sbt-protobuf" % pluginVersion)
else addSbtPlugin("com.github.sbt" % "sbt-protobuf" % pluginVersion)
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
if(pluginVersion == null)
throw new RuntimeException("""|The system property 'plugin.version' is not defined.
|Specify this property using the scriptedLaunchOpts -D.""".stripMargin)
else addSbtPlugin("com.github.gseitz" % "sbt-protobuf" % pluginVersion)
else addSbtPlugin("com.github.sbt" % "sbt-protobuf" % pluginVersion)
}
2 changes: 1 addition & 1 deletion src/sbt-test/sbt-protobuf/protojar/project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
if(pluginVersion == null)
throw new RuntimeException("""|The system property 'plugin.version' is not defined.
|Specify this property using the scriptedLaunchOpts -D.""".stripMargin)
else addSbtPlugin("com.github.gseitz" % "sbt-protobuf" % pluginVersion)
else addSbtPlugin("com.github.sbt" % "sbt-protobuf" % pluginVersion)
}
2 changes: 1 addition & 1 deletion src/sbt-test/sbt-protobuf/task-scoped/project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
if(pluginVersion == null)
throw new RuntimeException("""|The system property 'plugin.version' is not defined.
|Specify this property using the scriptedLaunchOpts -D.""".stripMargin)
else addSbtPlugin("com.github.gseitz" % "sbt-protobuf" % pluginVersion)
else addSbtPlugin("com.github.sbt" % "sbt-protobuf" % pluginVersion)
}
1 change: 0 additions & 1 deletion version.sbt

This file was deleted.

0 comments on commit ace337c

Please sign in to comment.