Skip to content
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
7 changes: 5 additions & 2 deletions .github/workflows/website-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,11 @@ jobs:
- name: Build
run: |
cd ../
sbt -batch -error 'print stableVersion' # something unexpected gets added to stdout on first run
export CHATOPS4S_VERSION=$(sbt -batch -error 'print stableVersion' | head -n 1)
# sbt stdout is not machine-readable (ANSI escapes, progress lines), so the
# version is written to a file by the build instead of being parsed from stdout.
sbt -batch writeStableVersion
export CHATOPS4S_VERSION=$(cat target/stable-version.txt)
echo "Building website for chatops4s $CHATOPS4S_VERSION"
cd website
yarn build
- name: Setup Pages
Expand Down
12 changes: 12 additions & 0 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,18 @@ stableVersion := {
else previousStableVersion.value.getOrElse("unreleased")
}

lazy val stableVersionFile = settingKey[File]("File that writeStableVersion writes to")
stableVersionFile := (ThisBuild / baseDirectory).value / "target" / "stable-version.txt"

// Writing to a file instead of printing, because sbt's stdout is not machine-readable
// (ANSI escapes, progress lines, launcher output). Consumed by the website build.
lazy val writeStableVersion = taskKey[Unit]("Writes stableVersion to stableVersionFile")
writeStableVersion := {
val target = stableVersionFile.value
IO.write(target, stableVersion.value)
streams.value.log.info(s"Wrote stable version to $target")
}

lazy val commonSettings = Seq(
scalaVersion := "3.8.1",
scalacOptions ++= Seq(
Expand Down
Loading