From ace337cedcffc9d1ea1efacaed46b798121b7aaf Mon Sep 17 00:00:00 2001 From: xuwei-k <6b656e6a69@gmail.com> Date: Tue, 2 Mar 2021 07:09:58 +0900 Subject: [PATCH] use sbt-ci-release. change groupId --- .github/workflows/ci.yml | 2 + .github/workflows/release.yml | 21 +++++++++ build.sbt | 47 ++++++++----------- project/plugins.sbt | 2 +- .../delete/clear-dir/project/plugins.sbt | 2 +- .../delete/single-file/project/plugins.sbt | 2 +- .../sbt-protobuf/basic/project/plugins.sbt | 2 +- .../multi-project/project/plugins.sbt | 2 +- .../sbt-protobuf/protojar/project/plugins.sbt | 2 +- .../task-scoped/project/plugins.sbt | 2 +- version.sbt | 1 - 11 files changed, 49 insertions(+), 36 deletions(-) create mode 100644 .github/workflows/release.yml delete mode 100644 version.sbt diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1ff58f2..4ea312e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 }}" diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..45292e9 --- /dev/null +++ b/.github/workflows/release.yml @@ -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" diff --git a/build.sbt b/build.sbt index 99697b1..437e617 100644 --- a/build.sbt +++ b/build.sbt @@ -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" @@ -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 := { + { + Seq( + ("xuwei-k", "Kenji Yoshida"), + ("eed3si9n", "Eugene Yokota"), + ).map { case (id, name) => + + {id} + {name} + https://github.com/{id} + + } + } + } 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 - ) }) diff --git a/project/plugins.sbt b/project/plugins.sbt index a43edcb..b513d95 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -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") diff --git a/src/sbt-test/delete/clear-dir/project/plugins.sbt b/src/sbt-test/delete/clear-dir/project/plugins.sbt index 9538690..8a234b4 100644 --- a/src/sbt-test/delete/clear-dir/project/plugins.sbt +++ b/src/sbt-test/delete/clear-dir/project/plugins.sbt @@ -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) } diff --git a/src/sbt-test/delete/single-file/project/plugins.sbt b/src/sbt-test/delete/single-file/project/plugins.sbt index 9538690..8a234b4 100644 --- a/src/sbt-test/delete/single-file/project/plugins.sbt +++ b/src/sbt-test/delete/single-file/project/plugins.sbt @@ -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) } diff --git a/src/sbt-test/sbt-protobuf/basic/project/plugins.sbt b/src/sbt-test/sbt-protobuf/basic/project/plugins.sbt index 9538690..8a234b4 100644 --- a/src/sbt-test/sbt-protobuf/basic/project/plugins.sbt +++ b/src/sbt-test/sbt-protobuf/basic/project/plugins.sbt @@ -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) } diff --git a/src/sbt-test/sbt-protobuf/multi-project/project/plugins.sbt b/src/sbt-test/sbt-protobuf/multi-project/project/plugins.sbt index 9538690..8a234b4 100644 --- a/src/sbt-test/sbt-protobuf/multi-project/project/plugins.sbt +++ b/src/sbt-test/sbt-protobuf/multi-project/project/plugins.sbt @@ -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) } diff --git a/src/sbt-test/sbt-protobuf/protojar/project/plugins.sbt b/src/sbt-test/sbt-protobuf/protojar/project/plugins.sbt index 9538690..8a234b4 100644 --- a/src/sbt-test/sbt-protobuf/protojar/project/plugins.sbt +++ b/src/sbt-test/sbt-protobuf/protojar/project/plugins.sbt @@ -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) } diff --git a/src/sbt-test/sbt-protobuf/task-scoped/project/plugins.sbt b/src/sbt-test/sbt-protobuf/task-scoped/project/plugins.sbt index 3daada3..717b882 100644 --- a/src/sbt-test/sbt-protobuf/task-scoped/project/plugins.sbt +++ b/src/sbt-test/sbt-protobuf/task-scoped/project/plugins.sbt @@ -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) } diff --git a/version.sbt b/version.sbt deleted file mode 100644 index 69e3580..0000000 --- a/version.sbt +++ /dev/null @@ -1 +0,0 @@ -ThisBuild / version := "0.6.6-SNAPSHOT"