From 1fb3e8f45f4c04b5105c9cd38f587ac1bfd4f94d Mon Sep 17 00:00:00 2001 From: Alexander Slesarenko Date: Sun, 26 Feb 2023 21:18:13 +0100 Subject: [PATCH 1/4] fix publishing --- .github/workflows/release.yml | 2 +- build.sbt | 21 +++++++++++++++++++-- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 584e7bfc..89093969 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -37,7 +37,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..74bfb0fa 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" @@ -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")) From 0b5087eb3d09aa47c7b805c586954229c4f4aa50 Mon Sep 17 00:00:00 2001 From: Alexander Slesarenko Date: Sun, 26 Feb 2023 21:46:22 +0100 Subject: [PATCH 2/4] change noble version --- build.sbt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sbt b/build.sbt index 74bfb0fa..ed459f68 100644 --- a/build.sbt +++ b/build.sbt @@ -83,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 ) From 99c24b0dbda17f60bc1a28bf1c51dfafbcf4b39c Mon Sep 17 00:00:00 2001 From: Alexander Slesarenko Date: Sun, 26 Feb 2023 21:53:47 +0100 Subject: [PATCH 3/4] fix noble version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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", From 0a7383a4c84272b8bfbfcd87686e37bc8f445bea Mon Sep 17 00:00:00 2001 From: Alexander Slesarenko Date: Sun, 26 Feb 2023 22:52:31 +0100 Subject: [PATCH 4/4] setup NPM in release.yml --- .github/workflows/release.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 89093969..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: