Skip to content

Commit 3385c45

Browse files
committed
add publishing to GitHub Actions
1 parent 5c0ae70 commit 3385c45

File tree

2 files changed

+21
-23
lines changed

2 files changed

+21
-23
lines changed

.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}}

build.sbt

-23
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,6 @@ lazy val scalafixRules = project
172172
.settings(
173173
scalaModuleAutomaticModuleName := None,
174174
organization := (compat212JVM / organization).value,
175-
publishTo := (compat212JVM / publishTo).value,
176175
versionPolicyIntention := Compatibility.None,
177176
name := "scala-collection-migrations",
178177
scalaVersion := scalafixScala212,
@@ -292,7 +291,6 @@ lazy val scalafixTests = project
292291
.enablePlugins(BuildInfoPlugin, ScalafixTestkitPlugin)
293292

294293
val ciScalaVersion = sys.env.get("CI_SCALA_VERSION").flatMap(Version.parse)
295-
val isTravisTag = sys.env.get("CI_TAG").exists(_.nonEmpty)
296294
val isScalaJs = sys.env.get("CI_PLATFORM") == Some("js")
297295
val isScalaNative = sys.env.get("CI_PLATFORM") == Some("native")
298296
val isScalafix = sys.env.get("CI_MODE") == Some("testScalafix")
@@ -322,7 +320,6 @@ inThisBuild {
322320
else {
323321
List(
324322
"CI_SCALA_VERSION",
325-
"CI_TAG",
326323
"CI_PLATFORM",
327324
"CI_MODE",
328325
"CI_JDK",
@@ -352,31 +349,11 @@ inThisBuild {
352349
compatProject
353350
}
354351

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-
374352
Seq(
375353
List(s"""++${sys.env.get("CI_SCALA_VERSION").get}!"""),
376354
List(s"$projectPrefix/clean"),
377355
List(s"$testProjectPrefix/test"),
378356
List(s"$projectPrefix/publishLocal"),
379-
publishTask
380357
).flatten
381358
}
382359

0 commit comments

Comments
 (0)