diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 584e7bfc..ad4205f6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -14,6 +14,14 @@ jobs: steps: - uses: actions/checkout@v2 + - name: Setup NPM + uses: pnpm/action-setup@v2 + with: + version: 7.21.0 + node-version: ${{ matrix.node-version }} + cache: "pnpm" + - run: pnpm install + - name: Setup Java and Scala uses: olafurpg/setup-scala@v10 with: @@ -37,7 +45,7 @@ jobs: GPG_SIGNING_KEY: ${{ secrets.GPG_SIGNING_KEY }} - name: Publish release ${{ github.ref }} - run: sbt +publishSigned sonatypeBundleRelease + run: sbt +scryptoJVM/publishSigned +scryptoJS/publishSigned sonatypeBundleRelease env: PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }} SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} diff --git a/build.sbt b/build.sbt index 93710647..ed459f68 100644 --- a/build.sbt +++ b/build.sbt @@ -2,6 +2,7 @@ import sbt.Keys.{homepage, scalaVersion} name := "scrypto" description := "Cryptographic primitives for Scala" +organization := "org.scorexfoundation" lazy val scala213 = "2.13.8" lazy val scala212 = "2.12.15" @@ -33,13 +34,14 @@ lazy val commonSettings = Seq( ), libraryDependencies ++= Seq( "org.rudogma" %%% "supertagged" % "2.0-RC2", - "org.scorexfoundation" %%% "scorex-util" % "0.1.8-20-565873cd-SNAPSHOT", + "org.scorexfoundation" %%% "scorex-util" % "0.2.0", "org.scalatest" %%% "scalatest" % "3.3.0-SNAP3" % Test, "org.scalatest" %%% "scalatest-propspec" % "3.3.0-SNAP3" % Test, "org.scalatest" %%% "scalatest-shouldmatchers" % "3.3.0-SNAP3" % Test, "org.scalatestplus" %%% "scalacheck-1-15" % "3.3.0.0-SNAP3" % Test, "org.scalacheck" %%% "scalacheck" % "1.15.2" % Test ), + javacOptions ++= javacReleaseOption, publishMavenStyle := true, publishTo := sonatypePublishToBundle.value ) @@ -50,9 +52,15 @@ Test / publishArtifact := false pomIncludeRepository := { _ => false } +lazy val noPublishSettings = Seq( + publish := {}, + publishLocal := {}, + publishArtifact := false +) + lazy val scrypto = crossProject(JVMPlatform, JSPlatform) .in(file(".")) - .settings(commonSettings: _*) + .settings(commonSettings) .jvmSettings( libraryDependencies ++= Seq( "org.bouncycastle" % "bcprov-jdk15to18" % "1.66" @@ -75,7 +83,7 @@ lazy val scryptoJS = scrypto.js // how to setup ScalablyTyped https://youtu.be/hWUAVrNj65c?t=1341 externalNpm := { file(s"${baseDirectory.value}/..") }, Compile / npmDependencies ++= Seq( - "@noble/hashes" -> "^1.1.4" + "@noble/hashes" -> "1.1.4" ), useYarn := true ) @@ -89,6 +97,15 @@ lazy val benchmarks = project scalaVersion := scala213, ) .enablePlugins(JmhPlugin) + .settings(noPublishSettings) + +def javacReleaseOption = { + if (System.getProperty("java.version").startsWith("1.")) + // java <9 "--release" is not supported + Seq() + else + Seq("--release", "8") +} credentials ++= (for { username <- Option(System.getenv().get("SONATYPE_USERNAME")) diff --git a/package.json b/package.json index 5dd17a63..e7978270 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ }, "homepage": "https://github.com/input-output-hk/scrypto/README.md", "dependencies": { - "@noble/hashes": "^1.1.4" + "@noble/hashes": "1.1.4" }, "devDependencies": { "jest": "^29.0.3",