Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix publising #102

Merged
merged 4 commits into from
Mar 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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 }}
Expand Down
23 changes: 20 additions & 3 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
)
Expand All @@ -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"
Expand All @@ -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
)
Expand All @@ -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"))
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down