From 23677e7442e010e229c32e30b9ea2021d427e205 Mon Sep 17 00:00:00 2001 From: Nikita Gazarov Date: Mon, 4 Dec 2023 13:58:02 -0800 Subject: [PATCH] Build: Point source maps online only when running from CI --- .github/workflows/release.yml | 3 +++ .github/workflows/test.yml | 3 +++ build.sbt | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9fe6aff0..ed771f37 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -5,6 +5,9 @@ on: branches: [publish] tags: ["*"] +env: + CI: true + jobs: publish: runs-on: ubuntu-22.04 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b3f07155..fe8383a9 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -6,6 +6,9 @@ on: pull_request: branches: [ '**' ] +env: + CI: true + jobs: build: runs-on: ubuntu-latest diff --git a/build.sbt b/build.sbt index 6c4430a9..b63c727e 100644 --- a/build.sbt +++ b/build.sbt @@ -97,7 +97,7 @@ lazy val laminar = project.in(file(".")) )) }, - scalacOptions += { + scalacOptions ++= sys.env.get("CI").map { _ => val localSourcesPath = baseDirectory.value.toURI val remoteSourcesPath = s"https://raw.githubusercontent.com/raquo/Laminar/${git.gitHeadCommit.value.get}/" val sourcesOptionName = if (scalaVersion.value.startsWith("2.")) "-P:scalajs:mapSourceURI" else "-scalajs-mapSourceURI"