Skip to content

Commit

Permalink
Merge pull request #460 from olafurpg/ci-release
Browse files Browse the repository at this point in the history
Setup automated releases from GitHub Actions CI
  • Loading branch information
johnynek authored Dec 3, 2020
2 parents 333b0e3 + c5c8bc0 commit 65b721a
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 30 deletions.
7 changes: 7 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
version: 2
updates:

- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "monthly"
19 changes: 19 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Release
on:
push:
branches: [develop]
tags: ["*"]
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: olafurpg/setup-scala@v10
- uses: olafurpg/setup-gpg@v3
- name: Publish ${{ github.ref }}
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 }}
27 changes: 1 addition & 26 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import com.typesafe.tools.mima.plugin.MimaPlugin.mimaDefaultSettings
import com.typesafe.tools.mima.plugin.MimaKeys.{mimaBinaryIssueFilters, mimaPreviousArtifacts}
import com.typesafe.sbt.osgi.SbtOsgi
import com.typesafe.sbt.osgi.SbtOsgi.autoImport._
import ReleaseTransformations._ // for sbt-release.
import bijection._

val twitterLibVersion = "20.10.0"
Expand Down Expand Up @@ -85,31 +84,6 @@ val buildLevelSettings = Seq(
)

val sharedSettings = Seq(
// Publishing options:
publishTo := Some {
if (version.value.trim.endsWith("SNAPSHOT")) Opts.resolver.sonatypeSnapshots
else Opts.resolver.sonatypeStaging
},
releaseCrossBuild := true,
releasePublishArtifactsAction := (PgpKeys.publishSigned in ThisProject).value,
releaseVersionBump := sbtrelease.Version.Bump.Minor, // need to tweak based on mima results
publishMavenStyle := true,
publishArtifact in Test := false,
pomIncludeRepository := { x => false },
releaseProcess := Seq[ReleaseStep](
checkSnapshotDependencies,
inquireVersions,
runClean,
runTest,
setReleaseVersion,
commitReleaseVersion,
tagRelease,
publishArtifacts,
setNextVersion,
commitNextVersion,
ReleaseStep(action = Command.process("sonatypeReleaseAll", _)),
pushChanges
),
OsgiKeys.importPackage ++= Seq(
s"""scala.*;version="$$<range;[==,=+);${scalaVersion.value}>"""",
"com.twitter.bijection.*;version=\"[${Bundle-Version}, ${Bundle-Version}]\"",
Expand Down Expand Up @@ -207,6 +181,7 @@ lazy val bijection = {
)
.settings(
mimaFailOnNoPrevious := false,
crossScalaVersions := Nil,
test := {},
publish := {}, // skip publishing for this root project.
publishLocal := {}
Expand Down
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.github.gseitz" % "sbt-release" % "1.0.13")
addSbtPlugin("com.jsuereth" % "sbt-pgp" % "2.0.1")
addSbtPlugin("com.typesafe" % "sbt-mima-plugin" % "0.8.1")
addSbtPlugin("com.typesafe.sbt" % "sbt-ghpages" % "0.6.3")
addSbtPlugin("com.typesafe.sbt" % "sbt-osgi" % "0.9.6")
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.6.1")
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.2")
addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "3.9.5")
addSbtPlugin("com.geirsson" % "sbt-ci-release" % "1.5.3")
1 change: 0 additions & 1 deletion version.sbt

This file was deleted.

0 comments on commit 65b721a

Please sign in to comment.