diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..21dcd4e --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,24 @@ +name: Release +on: + push: + branches: [main] + tags: ["*"] +jobs: + publish: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v5 + with: + fetch-depth: 0 + - uses: actions/setup-java@v5 + with: + java-version: 8 + distribution: adopt + - uses: sbt/setup-sbt@v1 + - uses: coursier/cache-action@v6 + - run: sbt ci-release + env: + PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }} + PGP_SECRET: ${{ secrets.PGP_SECRET }} + SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} + SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} diff --git a/build.sbt b/build.sbt index d1d915c..439004f 100644 --- a/build.sbt +++ b/build.sbt @@ -1,5 +1,4 @@ inThisBuild(Seq( - version := "1.1.1-SNAPSHOT", organization := "org.scala-js", crossScalaVersions := Seq("2.12.10", "2.11.12", "2.13.1"), @@ -24,14 +23,6 @@ val commonSettings = Def.settings( }, autoAPIMappings := true, - publishMavenStyle := true, - publishTo := { - val nexus = "https://oss.sonatype.org/" - if (isSnapshot.value) - Some("snapshots" at nexus + "content/repositories/snapshots") - else - Some("releases" at nexus + "service/local/staging/deploy/maven2") - }, pomExtra := ( @@ -56,13 +47,11 @@ val commonSettings = Def.settings( lazy val root: Project = project.in(file(".")). settings( - publishArtifact in Compile := false, - publish := {}, - publishLocal := {}, + publish / skip := true, clean := clean.dependsOn( - clean in `scalajs-env-jsdom-nodejs`, - clean in `test-project` + `scalajs-env-jsdom-nodejs` / clean, + `test-project` / clean, ).value ) @@ -91,6 +80,7 @@ lazy val `test-project`: Project = project. enablePlugins(ScalaJSPlugin). enablePlugins(ScalaJSJUnitPlugin). settings( + publish / skip := true, scalaJSUseMainModuleInitializer := true, jsEnv := new org.scalajs.jsenv.jsdomnodejs.JSDOMNodeJSEnv() ) diff --git a/project/build.properties b/project/build.properties index c0bab04..01a16ed 100644 --- a/project/build.properties +++ b/project/build.properties @@ -1 +1 @@ -sbt.version=1.2.8 +sbt.version=1.11.7 diff --git a/project/plugins.sbt b/project/plugins.sbt index 7a00941..f0eb7d8 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -1,6 +1,7 @@ addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.0.0") +addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.11.2") libraryDependencies += "org.scala-js" %% "scalajs-env-nodejs" % "1.0.0" -unmanagedSourceDirectories in Compile += +Compile / unmanagedSourceDirectories += baseDirectory.value.getParentFile / "jsdom-nodejs-env/src/main/scala"