diff --git a/.github/workflows/actions.yml b/.github/workflows/actions.yml index 12171d993..1e6fa84d5 100644 --- a/.github/workflows/actions.yml +++ b/.github/workflows/actions.yml @@ -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 @@ -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 }} diff --git a/build.sc b/build.sc index d87f0e2bf..3247d8bc6 100644 --- a/build.sc +++ b/build.sc @@ -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" @@ -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. @@ -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) { @@ -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() + } + () } }