Skip to content

Commit 985f4e5

Browse files
committed
Switch to using sbt-ci-release, with github actions
1 parent ceb679d commit 985f4e5

File tree

3 files changed

+47
-22
lines changed

3 files changed

+47
-22
lines changed

.github/workflows/release.yml

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
- series/*
8+
tags:
9+
- '*'
10+
11+
jobs:
12+
build:
13+
runs-on: ubuntu-latest
14+
strategy:
15+
matrix:
16+
java: [1.14]
17+
scala: [2.12.11, 2.13.2]
18+
steps:
19+
- uses: actions/checkout@v2
20+
with:
21+
fetch-depth: 0
22+
- name: Set up JDK ${{ matrix.java }}
23+
uses: actions/setup-java@v1
24+
with:
25+
java-version: ${{ matrix.java }}
26+
- name: Cache Coursier
27+
uses: actions/cache@v1
28+
with:
29+
path: ~/.cache/coursier
30+
key: sbt-coursier-cache
31+
- name: Cache SBT
32+
uses: actions/cache@v1
33+
with:
34+
path: ~/.sbt
35+
key: sbt-${{ hashFiles('**/build.sbt') }}
36+
- name: Publish
37+
run: sbt ci-release
38+
env:
39+
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
40+
PGP_SECRET: ${{ secrets.PGP_SECRET }}
41+
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
42+
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}

build.sbt

+5-15
Original file line numberDiff line numberDiff line change
@@ -152,13 +152,10 @@ scalacOptions in (Compile, console) --= Seq("-Ywarn-unused:imports", "-Xfatal-wa
152152

153153
lazy val publishing = Seq(
154154
extras,
155-
credentials ++= travisCredentials.toSeq,
156-
publishMavenStyle in ThisBuild := true,
157155
publishArtifact in (ThisBuild, Test) := false,
158156
// Don't publish root pom. It's not needed.
159157
packagedArtifacts in LocalRootProject := Map.empty,
160158
publishArtifact in Test := false,
161-
publishTo in ThisBuild := Some(nexusRepoFor(version.value, isSnapshot.value)),
162159
scmInfo in ThisBuild := {
163160
val base = "github.com/http4s/rho"
164161
Some(
@@ -168,18 +165,6 @@ lazy val publishing = Seq(
168165
}
169166
)
170167

171-
lazy val travisCredentials =
172-
(envOrNone("SONATYPE_USERNAME"), envOrNone("SONATYPE_PASSWORD")) match {
173-
case (Some(user), Some(pass)) =>
174-
Some(
175-
Credentials("Sonatype Nexus Repository Manager",
176-
"oss.sonatype.org",
177-
user,
178-
pass))
179-
case _ =>
180-
None
181-
}
182-
183168
lazy val extras = pomExtra in ThisBuild := (
184169
<developers>
185170
<developer>
@@ -196,5 +181,10 @@ lazy val extras = pomExtra in ThisBuild := (
196181
<name>Ross A. Baker</name>
197182
<email>ross@rossabaker.com</email>
198183
</developer>
184+
<developer>
185+
<id>zarthross</id>
186+
<name>Darren A Gibson</name>
187+
<email>zarthross@gmail.com</email>
188+
</developer>
199189
</developers>
200190
)

project/RhoPlugin.scala

-7
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,6 @@ object RhoPlugin extends AutoPlugin {
1313

1414
val homepageUrl = "https://github.com/http4s/rho"
1515

16-
/** Some helper functions **************************************/
17-
def nexusRepoFor(version: String, isSnapshot: Boolean): Resolver = {
18-
val nexus = "https://oss.sonatype.org/"
19-
if (isSnapshot) "snapshots" at nexus + "content/repositories/snapshots"
20-
else "releases" at nexus + "service/local/staging/deploy/maven2"
21-
}
22-
2316
def extractApiVersion(version: String) = {
2417
val VersionExtractor = """(\d+)\.(\d+)\..*""".r
2518
version match {

0 commit comments

Comments
 (0)