Skip to content

Commit eae34c8

Browse files
committed
setup sbt-ci-release
1 parent 275c159 commit eae34c8

7 files changed

Lines changed: 64 additions & 60 deletions

File tree

.github/workflows/ci.yml

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,29 +14,21 @@ jobs:
1414
name: Build and Test
1515
strategy:
1616
matrix:
17-
scala: [2.13.14]
17+
scala: [2.13.16]
1818

1919
runs-on: ubuntu-latest
2020
steps:
2121
- name: Checkout current branch
22-
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
22+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2323
with:
2424
fetch-depth: 0
2525

2626
- name: Setup Java and Scala
27-
uses: olafurpg/setup-scala@32ffa16635ff8f19cc21ea253a987f0fdf29844c
27+
uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # 4.7.1
2828
with:
29-
java-version: adopt@1.11
30-
31-
- name: Cache sbt
32-
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
33-
with:
34-
path: |
35-
~/.sbt
36-
~/.ivy2/cache
37-
~/.coursier/cache/v1
38-
~/.cache/coursier/v1
39-
key: sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }}
29+
distribution: "temurin"
30+
java-version: "11"
31+
cache: "sbt"
4032

4133
- name: Build project
4234
run: sbt ++${{ matrix.scala }} test

.github/workflows/dependency-graph.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ jobs:
88
name: Update Dependency Graph
99
runs-on: ubuntu-latest
1010
steps:
11-
- uses: actions/checkout@v4
12-
with:
13-
fetch-depth: 0
14-
- uses: sbt/setup-sbt@v1
15-
- uses: scalacenter/sbt-dependency-submission@v3
11+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
12+
- name: Setup sbt
13+
uses: sbt/setup-sbt@26ab4b0fa1c47fa62fc1f6e51823a658fb6c760c # v1.1.7
14+
- uses: scalacenter/sbt-dependency-submission@64084844d2b0a9b6c3765f33acde2fbe3f5ae7d3 # v3.1.0

.github/workflows/release.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Release
2+
on:
3+
push:
4+
branches: [master]
5+
tags: ["*"]
6+
7+
jobs:
8+
publish:
9+
runs-on: ubuntu-latest
10+
env:
11+
JAVA_OPTS: -Xms2048M -Xmx2048M -Xss6M -XX:ReservedCodeCacheSize=256M -Dfile.encoding=UTF-8
12+
JVM_OPTS: -Xms2048M -Xmx2048M -Xss6M -XX:ReservedCodeCacheSize=256M -Dfile.encoding=UTF-8
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
16+
with:
17+
fetch-depth: 0
18+
19+
- name: Setup Java and Scala
20+
uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # 4.7.1
21+
with:
22+
distribution: temurin
23+
java-version: 11
24+
cache: sbt
25+
26+
- run: sbt ci-release
27+
env:
28+
PGP_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
29+
PGP_SECRET: ${{ secrets.GPG_PRIVATE_KEY }}
30+
SONATYPE_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
31+
SONATYPE_USERNAME: ${{ secrets.OSSRH_USERNAME }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,4 @@ tmp
2222
.metals
2323
metals.sbt
2424
.vscode
25+
.bsp

build.sbt

Lines changed: 19 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,26 @@ name := "IterablePlayUtils"
22
organization := "com.iterable"
33
homepage := Some(url("https://github.com/Iterable/iterable-play-utils"))
44
scmInfo := Some(
5-
ScmInfo(url("https://github.com/Iterable/iterable-play-utils"), "scm:git@github.com:Iterable/iterable-play-utils.git")
5+
ScmInfo(
6+
url("https://github.com/Iterable/iterable-play-utils"),
7+
"scm:git@github.com:Iterable/iterable-play-utils.git"
8+
)
69
)
710

8-
licenses := Seq("Apache-2.0" -> url("http://www.apache.org/licenses/LICENSE-2.0.txt"))
11+
licenses := Seq(
12+
"Apache-2.0" -> url("http://www.apache.org/licenses/LICENSE-2.0.txt")
13+
)
914
developers := List(
10-
Developer(id = "Iterable", name = "Iterable", email = "engineering@iterable.com", url = url("https://iterable.com"))
15+
Developer(
16+
id = "Iterable",
17+
name = "Iterable",
18+
email = "engineering@iterable.com",
19+
url = url("https://iterable.com")
20+
)
1121
)
1222

13-
scalaVersion := "2.13.14"
14-
crossScalaVersions := Seq(scalaVersion.value)
23+
scalaVersion := "2.13.16"
24+
crossScalaVersions := Seq("2.13.16")
1525

1626
val PlayVersion = "3.0.1"
1727

@@ -23,35 +33,8 @@ libraryDependencies ++= Seq(
2333
"org.scalatest" %% "scalatest" % "3.2.18" % Test
2434
)
2535

26-
parallelExecution in Test := false
27-
28-
publishTo := {
29-
val nexus = "https://oss.sonatype.org/"
30-
if (isSnapshot.value)
31-
Some("snapshots" at (nexus + "content/repositories/snapshots"))
32-
else
33-
Some("releases" at (nexus + "service/local/staging/deploy/maven2"))
34-
}
35-
36-
publishArtifact in Test := false
36+
import org.typelevel.scalacoptions.ScalacOptions
37+
Test / tpolecatExcludeOptions += ScalacOptions.warnNonUnitStatement
38+
Test / parallelExecution := false
39+
Test / publishArtifact := false
3740
pomIncludeRepository := (_ => false)
38-
39-
publishMavenStyle := true
40-
publishTo := sonatypePublishToBundle.value
41-
42-
import ReleaseTransformations._
43-
releaseCrossBuild := true
44-
releaseProcess := Seq[ReleaseStep](
45-
checkSnapshotDependencies,
46-
inquireVersions,
47-
runClean,
48-
runTest,
49-
setReleaseVersion,
50-
commitReleaseVersion,
51-
tagRelease,
52-
releaseStepCommandAndRemaining("+publishSigned"),
53-
releaseStepCommand("sonatypeBundleRelease"),
54-
setNextVersion,
55-
commitNextVersion,
56-
pushChanges
57-
)

project/build.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
sbt.version = 1.4.7
1+
sbt.version = 1.10.11

project/plugins.sbt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,2 @@
1-
addSbtPlugin("com.github.sbt" % "sbt-release" % "1.0.15")
2-
addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "3.9.5")
3-
addSbtPlugin("com.github.sbt" % "sbt-pgp" % "2.1.2")
4-
addSbtPlugin("io.github.davidgregory084" % "sbt-tpolecat" % "0.1.16")
1+
addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.5.12")
2+
addSbtPlugin("org.typelevel" % "sbt-tpolecat" % "0.5.2")

0 commit comments

Comments
 (0)