Skip to content

Commit 2b4ee8a

Browse files
authored
Merge pull request #1962 from scalacenter/sbt-ci-release
refactor(ci): migrate to sbt-ci-release
2 parents b085461 + a94f8ce commit 2b4ee8a

File tree

6 files changed

+21
-115
lines changed

6 files changed

+21
-115
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -248,12 +248,10 @@ jobs:
248248
env:
249249
CI: true
250250
SKIP_TEST_RESOURCES_GENERATION: true
251-
SONATYPE_USER: ${{ secrets.SONATYPE_USER }}
251+
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
252252
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
253-
PGP_PASSWORD: ${{ secrets.PGP_PASSWORD }}
254-
PGP_PASSPHRASE: ${{ secrets.PGP_PASSWORD }}
255-
PGP_PUBLIC_KEY: ${{ secrets.PGP_PUBLIC_KEY }}
256-
PGP_PRIVATE_KEY: ${{ secrets.PGP_PRIVATE_KEY }}
253+
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
254+
PGP_SECRET: ${{ secrets.PGP_SECRET }}
257255
GITHUB_DEPLOY_KEY: ${{ secrets.GITHUB_DEPLOY_KEY }}
258256
BLOOPOID_GITHUB_TOKEN: ${{ secrets.BLOOPOID_GITHUB_TOKEN }}
259257
BLOOPOID_SSH_PUBLIC_KEY: ${{ secrets.BLOOPOID_SSH_PUBLIC_KEY }}
@@ -283,18 +281,13 @@ jobs:
283281
run: |
284282
yarn install
285283
touch ~/.profile
286-
mkdir "$HOME/.ssh"
287-
mkdir "$HOME/.sbt"
288-
mkdir "$HOME/.sbt/gpg"
289284
git config --global user.name "Bloopoid"
290285
git config --global user.email "bloop@vican.me"
291286
git config --global push.default simple
292-
echo "$PGP_PUBLIC_KEY" > "$HOME/.sbt/gpg/pubring.asc"
293-
echo "$PGP_PRIVATE_KEY" > "$HOME/.sbt/gpg/secring.asc"
294287
ls -l bloop-artifacts
295288
mkdir -p frontend/target
296289
mv bloop-artifacts frontend/target/graalvm-binaries
297-
./bin/sbt-ci-publish.sh "releaseBloop" "docs/docusaurusPublishGhpages"
290+
./bin/sbt-ci-publish.sh "ci-release" "docs/docusaurusPublishGhpages"
298291
shell: bash
299292
- name: Cut GitHub release and update installers on ${{ matrix.os }}
300293
run: |

bin/set-up-keys.sh

Lines changed: 0 additions & 6 deletions
This file was deleted.

build.sbt

Lines changed: 11 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@ import build.BuildImplementation.BuildDefaults
22
import build.BuildImplementation.jvmOptions
33
import build.Dependencies
44
import build.Dependencies.{Scala211Version, Scala212Version, SbtVersion}
5-
import xerial.sbt.Sonatype.SonatypeKeys
6-
7-
Global / useGpg := false
85

96
ThisBuild / dynverSeparator := "-"
107

@@ -51,9 +48,8 @@ val benchmarkBridge = project
5148
.in(file(".benchmark-bridge-compilation"))
5249
.aggregate(BenchmarkBridgeCompilation)
5350
.disablePlugins(ScriptedPlugin)
54-
.settings(scalafixSettings)
5551
.settings(
56-
releaseEarly := { () },
52+
scalafixSettings,
5753
(publish / skip) := true
5854
)
5955

@@ -172,9 +168,9 @@ lazy val frontend: Project = project
172168
),
173169
dependencyOverrides += Dependencies.shapeless,
174170
scalafixSettings,
175-
releaseSettings,
176171
testSettings,
177172
testSuiteSettings,
173+
releaseSettings,
178174
Defaults.itSettings,
179175
BuildDefaults.frontendTestBuildSettings,
180176
inConfig(Compile)(
@@ -290,6 +286,7 @@ lazy val launcherTest = project
290286
.dependsOn(launcher, frontend % "test->test")
291287
.settings(
292288
name := "bloop-launcher-test",
289+
(publish / skip) := true,
293290
scalafixSettings,
294291
testSuiteSettings,
295292
(Test / fork) := true,
@@ -453,37 +450,22 @@ lazy val twitterIntegrationProjects = project
453450
)
454451

455452
val allProjects = Seq(
456-
bloopShared,
457453
backend,
458-
frontend,
459454
benchmarks,
460-
sbtBloop,
461-
nativeBridge04,
462-
jsBridge06,
463-
jsBridge1,
464-
launcher,
465-
launcher213,
466-
launcherTest,
467-
sockets,
468455
bloopgun,
469-
bloopgun213
470-
)
471-
472-
val allProjectsToRelease = Seq[ProjectReference](
456+
bloopgun213,
473457
bloopShared,
474-
backend,
458+
buildpress,
459+
buildpressConfig,
475460
frontend,
476-
sbtBloop,
477-
nativeBridge04,
478461
jsBridge06,
479462
jsBridge1,
480-
sockets,
481-
bloopgun,
482-
bloopgun213,
483463
launcher,
484464
launcher213,
485-
buildpressConfig,
486-
buildpress
465+
launcherTest,
466+
nativeBridge04,
467+
sbtBloop,
468+
sockets
487469
)
488470

489471
val allProjectReferences = allProjects.map(p => LocalProject(p.id))
@@ -492,26 +474,7 @@ val bloop = project
492474
.disablePlugins(ScriptedPlugin)
493475
.aggregate(allProjectReferences: _*)
494476
.settings(
495-
releaseEarly := { () },
496477
(publish / skip) := true,
497-
publishLocalAllModules := {
498-
BuildDefaults
499-
.publishLocalAllModules(allProjectsToRelease)
500-
.value
501-
},
502-
releaseEarlyAllModules := {
503-
BuildDefaults
504-
.releaseEarlyAllModules(allProjectsToRelease)
505-
.value
506-
},
507-
releaseSonatypeBundle := {
508-
Def.taskDyn {
509-
val bundleDir = SonatypeKeys.sonatypeBundleDirectory.value
510-
// Do nothing if sonatype bundle doesn't exist
511-
if (!bundleDir.exists) Def.task("")
512-
else SonatypeKeys.sonatypeBundleRelease
513-
}.value
514-
},
515478
exportCommunityBuild := {
516479
build.BuildImplementation
517480
.exportCommunityBuild(
@@ -528,7 +491,7 @@ val isWindows = scala.util.Properties.isWin
528491
addCommandAlias(
529492
"install",
530493
Seq(
531-
"publishLocalAllModules",
494+
"publishLocal",
532495
// Don't generate graalvm image if running in Windows
533496
if (isWindows) "" else "bloopgun/graalvm-native-image:packageBin",
534497
s"${frontend.id}/test:compile",
@@ -538,6 +501,3 @@ addCommandAlias(
538501
).filter(!_.isEmpty)
539502
.mkString(";", ";", "")
540503
)
541-
542-
val allReleaseActions = List("releaseEarlyAllModules", "sonatypeBundleRelease")
543-
addCommandAlias("releaseBloop", allReleaseActions.mkString(";", ";", ""))

project/BuildPlugin.scala

Lines changed: 3 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -2,29 +2,27 @@ package build
22

33
import java.io.File
44

5-
import ch.epfl.scala.sbt.release.Feedback
65
import com.jsuereth.sbtpgp.SbtPgp.{autoImport => Pgp}
76
import sbt._
87
import sbt.io.IO
98
import sbt.io.syntax.fileToRichFile
109
import sbt.librarymanagement.syntax.stringToOrganization
1110
import sbt.util.FileFunction
1211
import sbtdynver.GitDescribeOutput
13-
import ch.epfl.scala.sbt.release.ReleaseEarlyPlugin.{autoImport => ReleaseEarlyKeys}
1412
import sbt.internal.BuildLoader
1513
import sbt.librarymanagement.MavenRepository
1614
import sbt.util.Logger
1715
import sbtbuildinfo.BuildInfoPlugin.{autoImport => BuildInfoKeys}
16+
import com.geirsson.CiReleasePlugin
1817

1918
object BuildPlugin extends AutoPlugin {
2019
import sbt.plugins.JvmPlugin
2120
import sbt.plugins.IvyPlugin
2221
import com.jsuereth.sbtpgp.SbtPgp
23-
import ch.epfl.scala.sbt.release.ReleaseEarlyPlugin
2422

2523
override def trigger: PluginTrigger = allRequirements
2624
override def requires: Plugins =
27-
JvmPlugin && ReleaseEarlyPlugin && SbtPgp && IvyPlugin
25+
JvmPlugin && CiReleasePlugin && IvyPlugin
2826
val autoImport = BuildKeys
2927

3028
override def globalSettings: Seq[Def.Setting[_]] =
@@ -81,9 +79,6 @@ object BuildKeys {
8179
val createLocalArchPackage = Def.taskKey[Unit]("Create local ArchLinux package build files")
8280
val bloopCoursierJson = Def.taskKey[File]("Generate a versioned install script")
8381
val bloopLocalCoursierJson = Def.taskKey[File]("Generate a versioned install script")
84-
val releaseEarlyAllModules = Def.taskKey[Unit]("Release early all modules")
85-
val releaseSonatypeBundle = Def.taskKey[Unit]("Release sonatype bundle, do nothing if no release")
86-
val publishLocalAllModules = Def.taskKey[Unit]("Publish all modules locally")
8782

8883
// This has to be change every time the bloop config files format changes.
8984
val schemaVersion = Def.settingKey[String]("The schema version for our bloop build.")
@@ -171,9 +166,7 @@ object BuildKeys {
171166
Keys.name := name,
172167
Keys.sbtPlugin := true,
173168
Keys.sbtVersion := sbtVersion,
174-
Keys.target := (file("integrations") / "sbt-bloop" / "target" / sbtVersion).getAbsoluteFile,
175-
Keys.publishMavenStyle :=
176-
ReleaseEarlyKeys.releaseEarlyWith.value == ReleaseEarlyKeys.SonatypePublisher
169+
Keys.target := (file("integrations") / "sbt-bloop" / "target" / sbtVersion).getAbsoluteFile
177170
)
178171

179172
def benchmarksSettings(dep: Reference): Seq[Def.Setting[_]] = List(
@@ -240,9 +233,6 @@ object BuildImplementation {
240233
val sonatypeStaging = Resolver.sonatypeOssRepos("staging")
241234
(oldResolvers ++ sonatypeStaging).distinct
242235
},
243-
ReleaseEarlyKeys.releaseEarlyWith := {
244-
ReleaseEarlyKeys.SonatypePublisher
245-
},
246236
Keys.startYear := Some(2017),
247237
Keys.autoAPIMappings := true,
248238
Keys.publishMavenStyle := true,
@@ -275,7 +265,6 @@ object BuildImplementation {
275265
)
276266

277267
final val projectSettings: Seq[Def.Setting[_]] = Seq(
278-
ReleaseEarlyKeys.releaseEarlyPublish := BuildDefaults.releaseEarlyPublish.value,
279268
Keys.scalacOptions := {
280269
CrossVersion.partialVersion(Keys.scalaVersion.value) match {
281270
case Some((2, 13)) =>
@@ -427,36 +416,6 @@ object BuildImplementation {
427416
}
428417
)
429418

430-
val releaseEarlyPublish: Def.Initialize[Task[Unit]] = Def.task {
431-
val logger = Keys.streams.value.log
432-
val name = Keys.name.value
433-
// We force publishSigned for all of the modules, yes or yes.
434-
logger.info(Feedback.logReleaseSonatype(name))
435-
Pgp.PgpKeys.publishSigned.value
436-
}
437-
438-
def releaseEarlyAllModules(projects: Seq[sbt.ProjectReference]): Def.Initialize[Task[Unit]] = {
439-
Def.taskDyn {
440-
val filter = sbt.ScopeFilter(
441-
sbt.inProjects(projects: _*),
442-
sbt.inConfigurations(sbt.Compile)
443-
)
444-
445-
ReleaseEarlyKeys.releaseEarly.all(filter).map(_ => ())
446-
}
447-
}
448-
449-
def publishLocalAllModules(projects: Seq[sbt.ProjectReference]): Def.Initialize[Task[Unit]] = {
450-
Def.taskDyn {
451-
val filter = sbt.ScopeFilter(
452-
sbt.inProjects(projects: _*),
453-
sbt.inConfigurations(sbt.Compile)
454-
)
455-
456-
Keys.publishLocal.all(filter).map(_ => ())
457-
}
458-
}
459-
460419
// From sbt-sensible https://gitlab.com/fommil/sbt-sensible/issues/5, legal requirement
461420
val getLicense: Def.Initialize[Task[Seq[File]]] = Def.task {
462421
val orig = (Compile / Keys.resources).value

project/build.properties

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

project/build.sbt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ val `bloop-build` = project
1313
// Bumping this will causes issues. For now just lock it
1414
addSbtPlugin("pl.project13.scala" % "sbt-jmh" % "0.3.7"),
1515
addSbtPlugin("com.github.sbt" % "sbt-git" % "2.0.1"),
16-
addSbtPlugin("ch.epfl.scala" % "sbt-release-early" % "2.1.1+4-9d76569a"),
16+
addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.5.11"),
1717
addSbtPlugin("org.scalameta" % "sbt-mdoc" % "2.3.6"),
1818
addSbtPlugin("org.scala-debugger" % "sbt-jdi-tools" % "1.1.1"),
19-
addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % "1.8.1"),
19+
addSbtPlugin("com.github.sbt" % "sbt-native-packager" % "1.9.11"),
2020
libraryDependencies ++= List(
2121
"org.eclipse.jgit" % "org.eclipse.jgit" % "5.13.1.202206130422-r",
2222
"org.eclipse.jgit" % "org.eclipse.jgit.ssh.jsch" % "5.13.1.202206130422-r",

0 commit comments

Comments
 (0)