Skip to content

Commit

Permalink
Improve the GitHub action sbt-dependency-submission
Browse files Browse the repository at this point in the history
  • Loading branch information
FabioPinheiro committed Sep 29, 2024
1 parent 79ef57e commit df913be
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 4 deletions.
41 changes: 37 additions & 4 deletions .github/workflows/sbt-dependency-submission.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: [email protected]
- 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/[email protected]
- 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"]}
13 changes: 13 additions & 0 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -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]()

0 comments on commit df913be

Please sign in to comment.