From 8fa0042fb31efc47ee0fd01f05ab594a81b79dd7 Mon Sep 17 00:00:00 2001 From: Nikita Gazarov Date: Fri, 1 Mar 2024 23:06:35 -0800 Subject: [PATCH] Point source maps to github (#20) * Point source maps to github URLs * Disable doc link warnings Needed for +publishLocal to work --- .github/workflows/release.yml | 4 +++- .github/workflows/scala.yml | 3 +++ build.sbt | 12 ++++++++++++ 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 44150c0..03519e2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -3,6 +3,8 @@ on: push: branches: [publish] tags: ["*"] +env: + CI: true jobs: publish: runs-on: ubuntu-20.04 @@ -16,4 +18,4 @@ jobs: PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }} PGP_SECRET: ${{ secrets.PGP_SECRET }} SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} - SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} \ No newline at end of file + SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} diff --git a/.github/workflows/scala.yml b/.github/workflows/scala.yml index e2d8d49..eff5550 100644 --- a/.github/workflows/scala.yml +++ b/.github/workflows/scala.yml @@ -4,6 +4,9 @@ on: push: branches: [ '**' ] +env: + CI: true + jobs: build: diff --git a/build.sbt b/build.sbt index 650010d..abbd349 100644 --- a/build.sbt +++ b/build.sbt @@ -43,8 +43,20 @@ lazy val `url-dsl` = crossProject(JSPlatform, JVMPlatform) "org.scalatest" %%% "scalatest" % "3.2.14" % Test, "org.scalacheck" %%% "scalacheck" % "1.17.0" % Test, "org.scalameta" %%% "munit" % "0.7.29" % Test + ), + (Compile / doc / scalacOptions) ++= Seq( + "-no-link-warnings" // Suppress scaladoc "Could not find any member to link for" warnings ) ) + .jsSettings( + scalacOptions ++= sys.env.get("CI").map { _ => + val localSourcesPath = (LocalRootProject / baseDirectory).value.toURI + val remoteSourcesPath = s"https://raw.githubusercontent.com/sherpal/url-dsl/${git.gitHeadCommit.value.get}/" + val sourcesOptionName = if (scalaVersion.value.startsWith("2.")) "-P:scalajs:mapSourceURI" else "-scalajs-mapSourceURI" + + s"${sourcesOptionName}:$localSourcesPath->$remoteSourcesPath" + } + ) .jvmSettings( coverageFailOnMinimum := true, coverageMinimumStmtTotal := 99,