Skip to content

Commit 82ab49f

Browse files
committed
Configure sbt-ci-release plugin.
1 parent c1595af commit 82ab49f

File tree

4 files changed

+26
-45
lines changed

4 files changed

+26
-45
lines changed

.github/workflows/release.yml

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Release
2+
on:
3+
push:
4+
branches: [master, main]
5+
tags: ["*"]
6+
jobs:
7+
publish:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v4
11+
with:
12+
fetch-depth: 0
13+
- uses: actions/setup-java@v4
14+
with:
15+
distribution: temurin
16+
java-version: 8
17+
cache: sbt
18+
- run: sbt ci-release
19+
env:
20+
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
21+
PGP_SECRET: ${{ secrets.PGP_SECRET }}
22+
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
23+
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}

build.sbt

+1-40
Original file line numberDiff line numberDiff line change
@@ -41,39 +41,14 @@ lazy val buildSettings = Def.settings(
4141
Compile / parallelExecution := true
4242
)
4343

44-
lazy val publishSetting = {
45-
publishTo := {
46-
val nexus = "https://oss.sonatype.org/"
47-
if (isSnapshot.value)
48-
Some("snapshots" at nexus + "content/repositories/snapshots")
49-
else
50-
Some("staging" at nexus + "service/local/staging/deploy/maven2")
51-
}
52-
}
53-
54-
lazy val credentialsSetting = credentials ++= {
55-
Seq("build.publish.user", "build.publish.password").map(k => Option(System.getProperty(k))) match {
56-
case Seq(Some(user), Some(pass)) =>
57-
Seq(Credentials("Sonatype Nexus Repository Manager", "oss.sonatype.org", user, pass))
58-
case _ =>
59-
val x = Path.userHome / ".ivy2" / ".credentials"
60-
if (x.exists) {
61-
Seq(Credentials(x))
62-
} else {
63-
Nil
64-
}
65-
}
66-
}
67-
6844
val scalazVersion = "7.3.8"
6945
val poiVersion = "5.2.5"
7046

7147
lazy val standardSettings = Def.settings(
7248
buildSettings,
49+
licenses := List("Apache-2.0" -> url("http://www.apache.org/licenses/LICENSE-2.0")),
7350
name := "poi-scala",
7451
Test / fork := true,
75-
releaseCrossBuild := true,
76-
releasePublishArtifactsAction := PgpKeys.publishSigned.value,
7752
libraryDependencies ++= {
7853
Seq(
7954
"org.apache.poi" % "poi" % poiVersion,
@@ -90,23 +65,9 @@ lazy val standardSettings = Def.settings(
9065
conflictWarning.value
9166
}
9267
},
93-
publishMavenStyle := true,
9468
Test / publishArtifact := false,
95-
credentialsSetting,
96-
publishSetting,
9769
pomExtra := (
9870
<url>https://github.com/folone/poi.scala</url>
99-
<licenses>
100-
<license>
101-
<name>Apache License</name>
102-
<url>http://opensource.org/licenses/Apache-2.0</url>
103-
<distribution>repo</distribution>
104-
</license>
105-
</licenses>
106-
<scm>
107-
<url>git@github.com:folone/poi.scala.git</url>
108-
<connection>scm:git:git@github.com:folone/poi.scala.git</connection>
109-
</scm>
11071
<developers>
11172
{
11273
Seq(

project/plugins.sbt

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
addSbtPlugin("com.github.sbt" % "sbt-pgp" % "2.2.1")
2-
3-
addSbtPlugin("com.github.sbt" % "sbt-release" % "1.1.0")
4-
51
addSbtPlugin("org.scalastyle" %% "scalastyle-sbt-plugin" % "1.0.0")
62

73
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.5.2")
4+
5+
addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.5.12")

version.sbt

-1
This file was deleted.

0 commit comments

Comments
 (0)