Skip to content

Commit b500ffb

Browse files
authored
overhaul CI and publishing (#14)
* replace Travis-CI with GitHub Actions * upgrade to sbt 1.x * remove sbt-scala-module (thereby dropping OSGi support) * publish with sbt-ci-release
1 parent 0139e1a commit b500ffb

15 files changed

+63
-249
lines changed

.github/workflows/ci.yml

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: test
2+
on:
3+
push:
4+
jobs:
5+
test:
6+
runs-on: ubuntu-latest
7+
steps:
8+
- uses: actions/checkout@v4
9+
- uses: actions/setup-java@v4
10+
with:
11+
distribution: temurin
12+
java-version: 8
13+
- uses: sbt/setup-sbt@v1
14+
- name: Test
15+
run: sbt test publishLocal

.github/workflows/cla.yml

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
name: "Check Scala CLA"
2+
on:
3+
pull_request:
4+
jobs:
5+
cla-check:
6+
runs-on: ubuntu-latest
7+
steps:
8+
- name: Verify CLA
9+
uses: scala/cla-checker@v1
10+
with:
11+
author: ${{ github.event.pull_request.user.login }}

.github/workflows/release.yml

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

.travis.yml

-22
This file was deleted.

admin/README.md

-69
This file was deleted.

admin/build.sh

-40
This file was deleted.

admin/encryptEnvVars.sh

-11
This file was deleted.

admin/genKeyPair.sh

-40
This file was deleted.

admin/gpg.sbt

-2
This file was deleted.

admin/publish-settings.sbt

-8
This file was deleted.

admin/pubring.asc

-18
This file was deleted.

admin/secring.asc.enc

-1.83 KB
Binary file not shown.

build.sbt

+13-34
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,16 @@
1-
import ScalaModulePlugin._
2-
3-
scalaModuleSettings
4-
scalaModuleSettingsJVM
5-
6-
name := "scala-asm"
7-
8-
enablePlugins(GitVersioning)
9-
lazy val AsmTag = """ASM_(\d+)_(\d+)(?:_(\d+))?(?:_([\w\d_]+))?(-\d+-[\w\d]+)?""".r
10-
lazy val ScalaAsmTag = """v(.*)""".r
11-
git.gitTagToVersionNumber := {
12-
case AsmTag(maj, min, pat, suf, des) =>
13-
// map a git-describe version built from an asm tag to a compatible version number
14-
val p = if (pat != null && pat != "") s".$pat" else ""
15-
val s = if (suf != null && suf != "") s"-$suf" else ""
16-
val d = if (des != null && des != "") des else ""
17-
Some(s"$maj.$min$p$s$d")
18-
case ScalaAsmTag(v) =>
19-
Some(v)
20-
case v =>
21-
throw new Error(s"Cannot get version number from git-describe: $v")
22-
}
23-
git.useGitDescribe := true
24-
25-
// No Scala sources, but still set some version. Need to set `crossScalaVersions` for the
26-
// sbt-scala-module plugin, which will then set scalaVersion.
27-
crossScalaVersions in ThisBuild := List("2.12.7")
28-
29-
// Otherwise the artifact has a dependency on scala-library
1+
// build
302
autoScalaLibrary := false
31-
32-
// Don't add `_<scala-version>` to the jar file name - it's a Java-only project, no Scala cross-versioning needed
333
crossPaths := false
4+
Compile / compile / javacOptions ++= Seq("-g", "-parameters")
345

35-
javacOptions in compile ++= Seq("-g", "-parameters")
36-
37-
OsgiKeys.exportPackage := Seq(s"scala.tools.asm.*;version=${version.value}")
6+
// publish
7+
name := "scala-asm"
8+
organization := "org.scala-lang.modules"
9+
sonatypeProfileName := "org.scala-lang"
10+
homepage := Some(url("https://github.com/scala/scala-asm"))
11+
licenses := Seq("BSD 3-clause" -> url("http://opensource.org/licenses/BSD-3-Clause"))
12+
scmInfo := Some(ScmInfo(url("https://github.com/scala/scala-asm"),
13+
"scm:git:[email protected]:scala/scala-asm.git"))
14+
15+
// override sbt-dynver (sbt-ci-release brings it, but we don't want it)
16+
version := "9.7.1-scala-1"

project/build.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
sbt.version=0.13.18
1+
sbt.version=1.10.6

project/plugins.sbt

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1 @@
1-
addSbtPlugin("org.scala-lang.modules" % "sbt-scala-module" % "1.0.14")
2-
3-
// Last version that works on Java 6
4-
addSbtPlugin("com.typesafe.sbt" % "sbt-git" % "0.8.5")
1+
addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.9.0")

0 commit comments

Comments
 (0)