Skip to content

Commit

Permalink
Try sbt-publish-ci (#1985)
Browse files Browse the repository at this point in the history
* no op change

* diff changes
  • Loading branch information
daniel-sudz authored Apr 10, 2022
1 parent ebbfeb7 commit 6434348
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 46 deletions.
25 changes: 5 additions & 20 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ name: Publish
on:
push:
branches:
- 'develop'
- "develop"
release:
types: [ created ]
types: [created]

jobs:
publish:
Expand All @@ -19,7 +19,7 @@ jobs:

- uses: actions/setup-java@v2
with:
distribution: 'adopt-openj9'
distribution: "adopt-openj9"
java-version: 8

- name: Set up Ruby
Expand All @@ -32,26 +32,11 @@ jobs:
gem install sass -v 3.7.4
gem install jekyll -v 3.2.1
# whenever a push is made to develop, this will run to publish a SNAPSHOT
- name: "Publish Snapshot"
if: ${{ github.event_name == 'push' }}
- name: "Publish"
env:
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
PGP_SECRET: ${{ secrets.PGP_SECRET }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
run: |
# snapshots will be versioned in the form of <latest version tag>-<commit SHA>-SNAPSHOT
# example: 0.16.1-RC2-377-0c41d610-SNAPSHOT
./sbt "release"
# whenever a release is triggered through Github UI, this will run to publish a final release
- name: "Publish Final Release"
if: ${{ github.event_name == 'release' && github.event.action == 'created' }}
env:
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
PGP_SECRET: ${{ secrets.PGP_SECRET }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
run: |
./sbt "release"
./sbt "ci-release"
26 changes: 1 addition & 25 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import ReleaseTransformations._
import com.typesafe.tools.mima.plugin.MimaPlugin.mimaDefaultSettings
import scala.collection.JavaConverters._
import microsites.ExtraMdFileConfig
Expand Down Expand Up @@ -63,6 +62,7 @@ val sharedSettings = Seq(
crossScalaVersions := Seq(scalaVersion.value, "2.12.14"),
javacOptions ++= Seq("-source", "1.8", "-target", "1.8"),
doc / javacOptions := Seq("-source", "1.8"),
versionScheme := Some("early-semver"),
Compile / compile / wartremoverErrors ++= Seq(
//Wart.OptionPartial, // this kills the ability to use serialization macros
Wart.ExplicitImplicitTypes,
Expand Down Expand Up @@ -125,32 +125,8 @@ val sharedSettings = Seq(
assembly / logLevel := Level.Warn,

// Publishing options:
releaseCrossBuild := true,
releasePublishArtifactsAction := PgpKeys.publishSigned.value,
ThisBuild / dynverSonatypeSnapshots := true, // prepend "-SNAPSHOT" to version tag when releasing a snapshot style build
ThisBuild / dynverSeparator := "-", // use a URI friendly separator for snapshots instead of '+' char
publishMavenStyle := true,
Test / publishArtifact := false,
pomIncludeRepository := { x => false },
releaseProcess := (
if (version.value.trim.endsWith("SNAPSHOT"))
Seq[ReleaseStep](
runClean,
publishArtifacts,
ReleaseStep(action = Command.process("sonatypeReleaseAll", _)),
)
else Seq[ReleaseStep](
checkSnapshotDependencies,
runClean,
publishArtifacts,
ReleaseStep(action = Command.process("sonatypeReleaseAll", _)),
)
),
publishTo := Some(
if (version.value.trim.endsWith("SNAPSHOT"))
Opts.resolver.sonatypeSnapshots
else Opts.resolver.sonatypeStaging
),

// Janino includes a broken signature, and is not needed:
assembly / assemblyExcludedJars := {
Expand Down
2 changes: 1 addition & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.14.6")
addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.11.0")
addSbtPlugin("com.eed3si9n" % "sbt-unidoc" % "0.4.3")
addSbtPlugin("com.47deg" % "sbt-microsites" % "1.3.4")
addSbtPlugin("com.github.sbt" % "sbt-release" % "1.1.0")
addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.5.10")
addSbtPlugin("com.dwijnand" % "sbt-dynver" % "4.1.1")
addSbtPlugin("com.github.sbt" % "sbt-pgp" % "2.1.2")
addSbtPlugin("com.twitter" %% "scrooge-sbt-plugin" % "18.9.0")
Expand Down

0 comments on commit 6434348

Please sign in to comment.