From df913be538163997ee02433e2cb10095bd212224 Mon Sep 17 00:00:00 2001 From: FabioPinheiro Date: Sun, 29 Sep 2024 12:57:20 +0100 Subject: [PATCH] Improve the GitHub action sbt-dependency-submission --- .../workflows/sbt-dependency-submission.yml | 41 +++++++++++++++++-- project/plugins.sbt | 13 ++++++ 2 files changed, 50 insertions(+), 4 deletions(-) diff --git a/.github/workflows/sbt-dependency-submission.yml b/.github/workflows/sbt-dependency-submission.yml index cab0e569..a4ad3743 100644 --- a/.github/workflows/sbt-dependency-submission.yml +++ b/.github/workflows/sbt-dependency-submission.yml @@ -2,16 +2,49 @@ # See https://github.com/marketplace/actions/sbt-dependency-submission name: Update Dependency Graph on: - push: - branches: - - master # default branch of the project + # push: + # branches: + # - master # default branch of the project + schedule: + - cron: "0 20 * * *" + workflow_dispatch: jobs: dependency-graph: name: Update Dependency Graph runs-on: ubuntu-latest # or windows-latest, or macOS-latest steps: - uses: actions/checkout@v3 + + - name: Setup Java and Scala + uses: olafurpg/setup-scala@v14 + with: + java-version: adopt@1.11 + - name: Setup Node + uses: actions/setup-node@v3 + with: + node-version: "18" # or whatever + - name: Setup Scala.JS + uses: japgolly/setup-scalajs@v1 + - name: Cache sbt + uses: coursier/cache-action@v6.3 + - name: npm install + run: npm install + - uses: scalacenter/sbt-dependency-submission@v2 with: working-directory: ./ - modules-ignore: root fmgp-ipfs-webapp + modules-ignore: + root_3 + all_3 + did-experiments_3 + did-experiments_sjs1_3 + scala-did-docs_3 + did-demo_sjs1_3 + # did-demo_3 + # fmgp-webapp_sjs1_3 + # didexample_3 + # didexample_sjs1_3 + # fmgp-serviceworker_sjs1_3 + configs-ignore: test scala-tool scala-doc-tool + +# githubGenerateSnapshot {"ignoredModules":["root_3", "all_3", "did-experiments_3", "did-experiments_sjs1_3", "scala-did-docs_3", "did-demo_sjs1_3"], "ignoredConfigs":["test", "scala-tool", "scala-doc-tool"]} diff --git a/project/plugins.sbt b/project/plugins.sbt index 762bc5b4..6f9f791c 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -72,3 +72,16 @@ addSbtPlugin("com.github.sbt" % "sbt-unidoc" % "0.5.0") // https://github.com/sb // Deploy demo - https://github.com/sbt/sbt-assembly/tags addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "2.2.0") addSbtPlugin("com.github.sbt" % "sbt-gzip" % "2.0.0") + +// To debug what the job sends to https://github.com/FabioPinheiro/scala-did/security/dependabot +// See file in .github/workflows/sbt-dependency-submission.yml +if (sys.env.get("DEPEDABOT").isDefined) { + println(s"Adding plugin sbt-github-dependency-submission since env DEPEDABOT is defined.") + // The reason for this is that the plugin needs the variable to be defined. We don't want to have that requirement. + libraryDependencies += { + val dependency = "ch.epfl.scala" % "sbt-github-dependency-submission" % "3.1.0" + val sbtV = (pluginCrossBuild / sbtBinaryVersion).value + val scalaV = (update / scalaBinaryVersion).value + Defaults.sbtPluginExtra(dependency, sbtV, scalaV) + } +} else libraryDependencies ++= Seq[ModuleID]()