Skip to content

Commit 21d73ae

Browse files
committed
add publishing to GitHub Actions
1 parent 5c0ae70 commit 21d73ae

File tree

2 files changed

+22
-25
lines changed

2 files changed

+22
-25
lines changed

Diff for: .github/workflows/release.yml

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

Diff for: build.sbt

+1-25
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,6 @@ lazy val binaryCompat = project
149149
scalaVersion := scala212,
150150
libraryDependencies += "com.typesafe" %% "mima-core" % "0.8.0" % Test,
151151
junit,
152-
versionPolicyIntention := Compatibility.None,
153152
buildInfoPackage := "build",
154153
buildInfoKeys := Seq[BuildInfoKey](
155154
"oldClasses" -> (binaryCompatOld / Compile / classDirectory).value.toString,
@@ -171,9 +170,8 @@ lazy val scalafixRules = project
171170
.settings(commonSettings)
172171
.settings(
173172
scalaModuleAutomaticModuleName := None,
174-
organization := (compat212JVM / organization).value,
175-
publishTo := (compat212JVM / publishTo).value,
176173
versionPolicyIntention := Compatibility.None,
174+
versionCheck := {}, // I don't understand why this fails otherwise?! oh well
177175
name := "scala-collection-migrations",
178176
scalaVersion := scalafixScala212,
179177
libraryDependencies += "ch.epfl.scala" %% "scalafix-core" % scalafixVersion
@@ -292,7 +290,6 @@ lazy val scalafixTests = project
292290
.enablePlugins(BuildInfoPlugin, ScalafixTestkitPlugin)
293291

294292
val ciScalaVersion = sys.env.get("CI_SCALA_VERSION").flatMap(Version.parse)
295-
val isTravisTag = sys.env.get("CI_TAG").exists(_.nonEmpty)
296293
val isScalaJs = sys.env.get("CI_PLATFORM") == Some("js")
297294
val isScalaNative = sys.env.get("CI_PLATFORM") == Some("native")
298295
val isScalafix = sys.env.get("CI_MODE") == Some("testScalafix")
@@ -322,7 +319,6 @@ inThisBuild {
322319
else {
323320
List(
324321
"CI_SCALA_VERSION",
325-
"CI_TAG",
326322
"CI_PLATFORM",
327323
"CI_MODE",
328324
"CI_JDK",
@@ -352,31 +348,11 @@ inThisBuild {
352348
compatProject
353349
}
354350

355-
val publishTask =
356-
if (isTravisTag && !isBinaryCompat && jdkVersion == Some(8)) {
357-
// we cannot run "ci-release" because that reads the `CI_RELEASE` / `CI_SONATYPE_RELEASE`
358-
// env vars, which we cannot modify from java (easily). so we inline what this command does.
359-
CiReleasePlugin.setupGpg()
360-
List(
361-
// same fix as https://github.com/olafurpg/sbt-ci-release/pull/66
362-
// need to replicate it here since we're not using the `ci-release` command
363-
"set pgpSecretRing := pgpSecretRing.value",
364-
"set pgpPublicRing := pgpPublicRing.value",
365-
s"$projectPrefix/publishSigned",
366-
"sonatypePrepare",
367-
"sonatypeBundleUpload",
368-
"sonatypeClose"
369-
)
370-
} else {
371-
Nil
372-
}
373-
374351
Seq(
375352
List(s"""++${sys.env.get("CI_SCALA_VERSION").get}!"""),
376353
List(s"$projectPrefix/clean"),
377354
List(s"$testProjectPrefix/test"),
378355
List(s"$projectPrefix/publishLocal"),
379-
publishTask
380356
).flatten
381357
}
382358

0 commit comments

Comments
 (0)