Skip to content

Commit

Permalink
Sample
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexITC committed Jul 4, 2022
1 parent 31bfc42 commit 25b1b8f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ jobs:
run: sbt +publishLocal

# Examples
- name: Compile examples - check library version
run: sbt version | tail -n 1 | awk -F " " '{print $2}' > .version
- name: Update examples/build.sbt
run: sbt printVersion && sed -i -e "s#SCALAJS_CHROME_VERSION#$(cat .version)#" examples/build.sbt

- name: Compile examples - set library version
run: sed -i -e "s#SCALAJS_CHROME_VERSION#$(cat .version)#" examples/project/plugins.sbt && sed -i -e "s#SCALAJS_CHROME_VERSION#$(cat .version)#" examples/build.sbt
- name: Update examples/project/plugins.sbt
run: sbt printVersion && sed -i -e "s#SCALAJS_CHROME_VERSION#$(cat .version)#" examples/project/plugins.sbt

- name: Compile examples
run: cd examples && sbt compile
run: cd examples && cat build.sbt && sbt chromePackage
10 changes: 9 additions & 1 deletion build.sbt
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import java.nio.file.Files

inThisBuild(
List(
organization := "com.alexitc",
Expand All @@ -16,6 +18,8 @@ inThisBuild(

ThisBuild / versionScheme := Some("early-semver")

lazy val printVersion = TaskKey[Unit]("printVersion")

lazy val commonSettings = Seq(
scalacOptions ++= {
Seq(
Expand Down Expand Up @@ -78,5 +82,9 @@ val root = project
.in(file("."))
.aggregate(bindings, plugin)
.settings(
publish / skip := true
publish / skip := true,
printVersion := {
val targetFile = baseDirectory.value / ".version"
Files.write(targetFile.toPath, version.value.getBytes(IO.utf8))
}
)

0 comments on commit 25b1b8f

Please sign in to comment.