From f5c7156e246c3ae17b5ecbaf735c7f0e6f78ecab Mon Sep 17 00:00:00 2001 From: Eugene Yokota Date: Wed, 2 Dec 2020 00:00:15 -0500 Subject: [PATCH] Tag-based release --- .github/workflows/release.yml | 35 +++++++++++++++++++++++++++++++++++ build.sbt | 11 ++++++++--- project/build.properties | 2 +- project/plugins.sbt | 5 +++-- 4 files changed, 47 insertions(+), 6 deletions(-) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 000000000..38f26929a --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,35 @@ +name: Release +on: + push: + tags: + - '*' +jobs: + build: + runs-on: ubuntu-latest + env: + # define Java options for both official sbt and sbt-extras + JAVA_OPTS: -Xms2048M -Xmx2048M -Xss6M -XX:ReservedCodeCacheSize=256M -Dfile.encoding=UTF-8 + JVM_OPTS: -Xms2048M -Xmx2048M -Xss6M -XX:ReservedCodeCacheSize=256M -Dfile.encoding=UTF-8 + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Setup Scala + uses: olafurpg/setup-scala@v10 + with: + java-version: "adopt@1.8" + - name: Coursier cache + uses: coursier/cache-action@v5 + - name: Test + run: | + sbt test packagedArtifacts + - name: Release + env: + BINTRAY_USER: ${{ secrets.BINTRAY_USER }} + BINTRAY_PASS: ${{ secrets.BINTRAY_PASS }} + PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }} + PGP_SECRET: ${{ secrets.PGP_SECRET }} + CI_CLEAN: clean + CI_RELEASE: publishSigned + CI_SONATYPE_RELEASE: version + run: | + sbt ci-release diff --git a/build.sbt b/build.sbt index f0bf1d455..ada51bd29 100644 --- a/build.sbt +++ b/build.sbt @@ -1,17 +1,22 @@ ThisBuild / organization := "com.eed3si9n" -ThisBuild / version := "0.6.1-SNAPSHOT" +ThisBuild / dynverSonatypeSnapshots := true +ThisBuild / version := { + val orig = (ThisBuild / version).value + if (orig.endsWith("-SNAPSHOT")) "0.7.0-SNAPSHOT" + else orig +} ThisBuild / description := "sbt plugin to define project matrix for cross building" ThisBuild / licenses := Seq("MIT License" -> url("https://github.com/sbt/sbt-projectmatrix/blob/master/LICENSE")) lazy val root = (project in file(".")) .enablePlugins(SbtPlugin) .settings( - sbtPlugin := true, name := "sbt-projectmatrix", + pluginCrossBuild / sbtVersion := "1.2.8", scalacOptions := Seq("-deprecation", "-unchecked"), publishMavenStyle := false, - bintrayOrganization in bintray := None, bintrayRepository := "sbt-plugins", + publishTo := (bintray / publishTo).value, scriptedLaunchOpts := { scriptedLaunchOpts.value ++ Seq("-Xmx1024M", "-Dplugin.version=" + version.value) }, diff --git a/project/build.properties b/project/build.properties index c0bab0494..7de0a9382 100644 --- a/project/build.properties +++ b/project/build.properties @@ -1 +1 @@ -sbt.version=1.2.8 +sbt.version=1.4.4 diff --git a/project/plugins.sbt b/project/plugins.sbt index e5ae08691..da5880d53 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -1,2 +1,3 @@ -addSbtPlugin("org.foundweekends" % "sbt-bintray" % "0.5.4") -addSbtPlugin("com.jsuereth" % "sbt-pgp" % "1.1.1") +addSbtPlugin("org.foundweekends" %% "sbt-bintray" % "0.6.1") +addSbtPlugin("com.jsuereth" % "sbt-pgp" % "2.0.2") +addSbtPlugin("com.geirsson" % "sbt-ci-release" % "1.5.4")