Skip to content

Commit

Permalink
CI: Run a site build to detect toolchain issues (#1451)
Browse files Browse the repository at this point in the history
Pull request: #1451
  • Loading branch information
lefou authored Mar 7, 2024
1 parent 0b2ae1a commit f009b37
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 11 deletions.
21 changes: 18 additions & 3 deletions .github/workflows/actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,21 @@ jobs:
distribution: temurin
- run: ./mill -i -k integrationTest ${{ matrix.scala-version }}

site:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-java@v4
with:
java-version: 8
distribution: temurin
- run: echo "Hello World" && ./mill -i publishDocs --skipDeploy true
shell: 'script -q -e -c "bash {0}"'
env:
TERM: xterm-256color

publishLocal:
strategy:
fail-fast: false
Expand All @@ -65,20 +80,20 @@ jobs:

release:
if: github.repository == 'com-lihaoyi/Ammonite' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/2.x')
needs: [ test, itest, publishLocal ]
needs: [ test, itest, site, publishLocal ]
uses: ./.github/workflows/release.yml
secrets: inherit

publishDosc:
if: github.repository == 'com-lihaoyi/Ammonite' && github.ref == 'refs/heads/main'
needs: [ test, itest ]
needs: [ test, itest, site ]
uses: ./.github/workflows/publishDocs.yml
secrets:
DEPLOY_KEY: ${{ secrets.DEPLOY_KEY }}

publishExecutable:
if: github.repository == 'com-lihaoyi/Ammonite' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/2.x')
needs: [ test, itest ]
needs: [ test, itest, site ]
uses: ./.github/workflows/publishExecutable.yml
secrets:
AMMONITE_BOT_AUTH_TOKEN: ${{ secrets.AMMONITE_BOT_AUTH_TOKEN }}
26 changes: 18 additions & 8 deletions build.sc
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
import $ivy.`com.lihaoyi::mill-contrib-bloop:$MILL_VERSION`
import $ivy.`io.get-coursier::coursier-launcher:2.1.0-RC1`
import $file.ci.upload

import mill._
import scalalib._
import publish._
import mill.contrib.bloop.Bloop
import mill.scalalib.api.ZincWorkerUtil._
import coursier.mavenRepositoryString
import $file.ci.upload

import $ivy.`com.lihaoyi::mill-contrib-bloop:$MILL_VERSION`
import $ivy.`io.get-coursier::coursier-launcher:2.1.0-RC1`
import mill.define.Command
import mill.testrunner.TestRunner

import scala.util.chaining.scalaUtilChainingOps

val ghOrg = "com-lihaoyi"
Expand Down Expand Up @@ -862,7 +863,7 @@ def publishExecutable() = {
}
}

def publishDocs() = {
def publishDocs(skipDeploy: Boolean = false): Command[Unit] = {
val ammoniteAssembly = amm(scala2_13Versions.last).assembly
// Disable doc auto-publishing for now, as the recent modularization means we
// need to make significant changes to the readme and that'll time.
Expand All @@ -884,12 +885,15 @@ def publishDocs() = {
e.printStackTrace()
throw e
}
()
}
else T.command {
println("MASTER COMMIT: Updating version and publishing to Github Pages")

val deployKey = sys.env("DEPLOY_KEY").replace("\\n", "\n")
os.write(os.pwd / "deploy_key", deployKey)
if (!skipDeploy) {
val deployKey = sys.env("DEPLOY_KEY").replace("\\n", "\n")
os.write(os.pwd / "deploy_key", deployKey)
}

val (stableKey, unstableKey, oldStableKeys, oldUnstableKeys) =
if (!unstable) {
Expand Down Expand Up @@ -935,7 +939,13 @@ def publishDocs() = {
"CONSTANTS_FILE" -> constantsFile.toString
)
)
os.proc("ci/deploy_master_docs.sh").call()
if (skipDeploy) {
println("Skip deployment")
} else {
println("Deploying ...")
os.proc("ci/deploy_master_docs.sh").call()
}
()
}
}

Expand Down

0 comments on commit f009b37

Please sign in to comment.