From c87f70633997b7243cf9d3e0172abfc0e18b07c7 Mon Sep 17 00:00:00 2001 From: Tobias Roland Rasmussen Date: Wed, 14 May 2025 10:48:48 +0100 Subject: [PATCH 1/2] AWS version bump (10 minor versions) --- build.sbt | 6 +++--- project/plugins.sbt | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/build.sbt b/build.sbt index 9d82d8c..1626974 100644 --- a/build.sbt +++ b/build.sbt @@ -17,7 +17,7 @@ ThisBuild / startYear := Some(2020) Global / excludeLintKeys += scmInfo val Scala213 = "2.13.10" -val scala3 = "3.3.1" +val scala3 = "3.3.6" ThisBuild / spiewakMainBranches := Seq("main") ThisBuild / crossScalaVersions := Seq(Scala213, scala3, "2.12.14") @@ -66,7 +66,7 @@ lazy val core = crossProject(JSPlatform, JVMPlatform) ) .jvmSettings( libraryDependencies ++= Seq( - "software.amazon.awssdk" % "dynamodb" % "2.21.14" + "software.amazon.awssdk" % "dynamodb" % "2.31.42" ) ) @@ -83,7 +83,7 @@ lazy val jsdocs = project .dependsOn(core.js) .settings( githubWorkflowArtifactUpload := false, - libraryDependencies += "org.scala-js" %%% "scalajs-dom" % "2.3.0" + libraryDependencies += "org.scala-js" %%% "scalajs-dom" % "2.8.0" ) .enablePlugins(ScalaJSPlugin) diff --git a/project/plugins.sbt b/project/plugins.sbt index 8f57d75..63f0eb3 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -1,6 +1,6 @@ addSbtPlugin("com.codecommit" % "sbt-spiewak-sonatype" % "0.23.0") addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.5.2") addSbtPlugin("org.scalameta" % "sbt-mdoc" % "2.4.0") -addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.14.0") +addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.19.0") addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "1.3.2") -addSbtPlugin("pl.project13.scala" % "sbt-jmh" % "0.4.6") +addSbtPlugin("pl.project13.scala" % "sbt-jmh" % "0.4.7") From 55bedc51426d9f08dfed4a3730cf4fccc3de6ebc Mon Sep 17 00:00:00 2001 From: Tobias Roland Rasmussen Date: Wed, 14 May 2025 16:09:21 +0100 Subject: [PATCH 2/2] Draft - switching to sbt-typelevel --- .github/workflows/ci.yml | 189 ------------------------------------ .github/workflows/clean.yml | 59 ----------- build.sbt | 76 +++++---------- project/build.properties | 2 +- project/plugins.sbt | 9 +- 5 files changed, 30 insertions(+), 305 deletions(-) delete mode 100644 .github/workflows/ci.yml delete mode 100644 .github/workflows/clean.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index 1c8ffea..0000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,189 +0,0 @@ -# This file was automatically generated by sbt-github-actions using the -# githubWorkflowGenerate task. You should add and commit this file to -# your git repository. It goes without saying that you shouldn't edit -# this file by hand! Instead, if you wish to make changes, you should -# change your sbt build configuration to revise the workflow description -# to meet your needs, then regenerate this file. - -name: Continuous Integration - -on: - pull_request: - branches: ['**'] - push: - branches: ['**'] - tags: [v*] - -env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} - SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} - PGP_SECRET: ${{ secrets.PGP_SECRET }} - -jobs: - build: - name: Build and Test - strategy: - matrix: - os: [ubuntu-latest] - scala: [2.13.10, 3.3.1, 2.12.14] - java: [temurin@11] - runs-on: ${{ matrix.os }} - steps: - - name: Checkout current branch (full) - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - - name: Setup Java (temurin@11) - if: matrix.java == 'temurin@11' - uses: actions/setup-java@v2 - with: - distribution: temurin - java-version: 11 - - - name: Cache sbt - uses: actions/cache@v2 - with: - path: | - ~/.sbt - ~/.ivy2/cache - ~/.coursier/cache/v1 - ~/.cache/coursier/v1 - ~/AppData/Local/Coursier/Cache/v1 - ~/Library/Caches/Coursier/v1 - key: ${{ runner.os }}-sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }} - - - name: Check that workflows are up to date - run: sbt ++${{ matrix.scala }} githubWorkflowCheck - - - run: sbt ++${{ matrix.scala }} ci - - - if: matrix.scala == '2.13.10' - run: sbt ++${{ matrix.scala }} docs/mdoc - - - name: Compress target directories - run: tar cf targets.tar target modules/core/js/target modules/core/jvm/target modules/benchmark/target project/target - - - name: Upload target directories - uses: actions/upload-artifact@v2 - with: - name: target-${{ matrix.os }}-${{ matrix.scala }}-${{ matrix.java }} - path: targets.tar - - publish: - name: Publish Artifacts - needs: [build] - if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v')) - strategy: - matrix: - os: [ubuntu-latest] - scala: [2.13.10] - java: [temurin@11] - runs-on: ${{ matrix.os }} - steps: - - name: Checkout current branch (full) - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - - name: Setup Java (temurin@11) - if: matrix.java == 'temurin@11' - uses: actions/setup-java@v2 - with: - distribution: temurin - java-version: 11 - - - name: Cache sbt - uses: actions/cache@v2 - with: - path: | - ~/.sbt - ~/.ivy2/cache - ~/.coursier/cache/v1 - ~/.cache/coursier/v1 - ~/AppData/Local/Coursier/Cache/v1 - ~/Library/Caches/Coursier/v1 - key: ${{ runner.os }}-sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }} - - - name: Download target directories (2.13.10) - uses: actions/download-artifact@v2 - with: - name: target-${{ matrix.os }}-2.13.10-${{ matrix.java }} - - - name: Inflate target directories (2.13.10) - run: | - tar xf targets.tar - rm targets.tar - - - name: Download target directories (3.3.1) - uses: actions/download-artifact@v2 - with: - name: target-${{ matrix.os }}-3.3.1-${{ matrix.java }} - - - name: Inflate target directories (3.3.1) - run: | - tar xf targets.tar - rm targets.tar - - - name: Download target directories (2.12.14) - uses: actions/download-artifact@v2 - with: - name: target-${{ matrix.os }}-2.12.14-${{ matrix.java }} - - - name: Inflate target directories (2.12.14) - run: | - tar xf targets.tar - rm targets.tar - - - name: Import signing key - run: echo $PGP_SECRET | base64 -d | gpg --import - - - run: sbt ++${{ matrix.scala }} release - - docs: - name: Deploy docs - needs: [publish] - if: always() && needs.build.result == 'success' && (needs.publish.result == 'success' || github.ref == 'refs/heads/docs-deploy') - strategy: - matrix: - os: [ubuntu-latest] - scala: [2.13.10] - java: [temurin@11] - runs-on: ${{ matrix.os }} - steps: - - name: Download target directories (2.13.10) - uses: actions/download-artifact@v2 - with: - name: target-${{ matrix.os }}-2.13.10-${{ matrix.java }} - - - name: Inflate target directories (2.13.10) - run: | - tar xf targets.tar - rm targets.tar - - - name: Download target directories (3.3.1) - uses: actions/download-artifact@v2 - with: - name: target-${{ matrix.os }}-3.3.1-${{ matrix.java }} - - - name: Inflate target directories (3.3.1) - run: | - tar xf targets.tar - rm targets.tar - - - name: Download target directories (2.12.14) - uses: actions/download-artifact@v2 - with: - name: target-${{ matrix.os }}-2.12.14-${{ matrix.java }} - - - name: Inflate target directories (2.12.14) - run: | - tar xf targets.tar - rm targets.tar - - - name: Deploy docs - uses: peaceiris/actions-gh-pages@v3 - with: - publish_dir: ./target/website - github_token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/clean.yml b/.github/workflows/clean.yml deleted file mode 100644 index 547aaa4..0000000 --- a/.github/workflows/clean.yml +++ /dev/null @@ -1,59 +0,0 @@ -# This file was automatically generated by sbt-github-actions using the -# githubWorkflowGenerate task. You should add and commit this file to -# your git repository. It goes without saying that you shouldn't edit -# this file by hand! Instead, if you wish to make changes, you should -# change your sbt build configuration to revise the workflow description -# to meet your needs, then regenerate this file. - -name: Clean - -on: push - -jobs: - delete-artifacts: - name: Delete Artifacts - runs-on: ubuntu-latest - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - steps: - - name: Delete artifacts - run: | - # Customize those three lines with your repository and credentials: - REPO=${GITHUB_API_URL}/repos/${{ github.repository }} - - # A shortcut to call GitHub API. - ghapi() { curl --silent --location --user _:$GITHUB_TOKEN "$@"; } - - # A temporary file which receives HTTP response headers. - TMPFILE=/tmp/tmp.$$ - - # An associative array, key: artifact name, value: number of artifacts of that name. - declare -A ARTCOUNT - - # Process all artifacts on this repository, loop on returned "pages". - URL=$REPO/actions/artifacts - while [[ -n "$URL" ]]; do - - # Get current page, get response headers in a temporary file. - JSON=$(ghapi --dump-header $TMPFILE "$URL") - - # Get URL of next page. Will be empty if we are at the last page. - URL=$(grep '^Link:' "$TMPFILE" | tr ',' '\n' | grep 'rel="next"' | head -1 | sed -e 's/.*.*//') - rm -f $TMPFILE - - # Number of artifacts on this page: - COUNT=$(( $(jq <<<$JSON -r '.artifacts | length') )) - - # Loop on all artifacts on this page. - for ((i=0; $i < $COUNT; i++)); do - - # Get name of artifact and count instances of this name. - name=$(jq <<<$JSON -r ".artifacts[$i].name?") - ARTCOUNT[$name]=$(( $(( ${ARTCOUNT[$name]} )) + 1)) - - id=$(jq <<<$JSON -r ".artifacts[$i].id?") - size=$(( $(jq <<<$JSON -r ".artifacts[$i].size_in_bytes?") )) - printf "Deleting '%s' #%d, %'d bytes\n" $name ${ARTCOUNT[$name]} $size - ghapi -X DELETE $REPO/actions/artifacts/$id - done - done diff --git a/build.sbt b/build.sbt index 1626974..9780f04 100644 --- a/build.sbt +++ b/build.sbt @@ -1,11 +1,10 @@ import com.typesafe.tools.mima.core.ReversedMissingMethodProblem import com.typesafe.tools.mima.core.ProblemFilters -Global / onChangedBuildSource := ReloadOnSourceChanges -ThisBuild / baseVersion := "0.3.0" +ThisBuild / tlBaseVersion := "0.3" ThisBuild / organization := "org.systemfw" -ThisBuild / publishGithubUser := "SystemFw" -ThisBuild / publishFullName := "Fabio Labella" +ThisBuild / organizationName := "SystemFw" +ThisBuild / licenses := Seq(License.Apache2) ThisBuild / homepage := Some(url("https://github.com/SystemFw/dynosaur")) ThisBuild / scmInfo := Some( ScmInfo( @@ -13,25 +12,27 @@ ThisBuild / scmInfo := Some( "git@github.com:SystemFw/dynosaur.git" ) ) +ThisBuild / developers := List( + "SystemFw" -> "Fabio Labella" +).map { case (username, fullname) => tlGitHubDev(username, fullname) } ThisBuild / startYear := Some(2020) -Global / excludeLintKeys += scmInfo val Scala213 = "2.13.10" val scala3 = "3.3.6" -ThisBuild / spiewakMainBranches := Seq("main") ThisBuild / crossScalaVersions := Seq(Scala213, scala3, "2.12.14") -ThisBuild / versionIntroduced := Map("3.0.0" -> "0.3.0") +ThisBuild / tlVersionIntroduced := Map("3.0.0" -> "0.3.0") ThisBuild / scalaVersion := (ThisBuild / crossScalaVersions).value.head + ThisBuild / initialCommands := """ - |import cats._, data._, syntax.all._ - |import dynosaur._ + |import cats._, data._, syntax.all._ + |import dynosaur._ """.stripMargin lazy val root = project .in(file(".")) - .enablePlugins(NoPublishPlugin, SonatypeCiReleasePlugin) - .aggregate(core.js, core.jvm, benchmark) + .disablePlugins(MimaPlugin) + .aggregate(core.js, core.jvm, benchmark, docs) lazy val core = crossProject(JSPlatform, JVMPlatform) .crossType(CrossType.Full) @@ -69,6 +70,8 @@ lazy val core = crossProject(JSPlatform, JVMPlatform) "software.amazon.awssdk" % "dynamodb" % "2.31.42" ) ) + .jsSettings( + ) lazy val coreJS = core.js lazy val coreJVM = core.jvm @@ -77,61 +80,30 @@ lazy val benchmark = project .in(file("modules/benchmark")) .dependsOn(core.jvm) .enablePlugins(JmhPlugin) - .disablePlugins(MimaPlugin) + .settings( + ) lazy val jsdocs = project + .in(file("jsdocs")) .dependsOn(core.js) .settings( - githubWorkflowArtifactUpload := false, libraryDependencies += "org.scala-js" %%% "scalajs-dom" % "2.8.0" ) - .enablePlugins(ScalaJSPlugin) + .enablePlugins(ScalaJSPlugin, NoPublishPlugin) lazy val docs = project .in(file("mdoc")) + .dependsOn(core.jvm) .settings( - mdocJS := Some(jsdocs), + name := "dynosaur-docs", mdocIn := file("docs"), - mdocOut := file("target/website"), mdocVariables := Map( "version" -> version.value, "scalaVersions" -> crossScalaVersions.value .map(v => s"- **$v**") - .mkString("\n") + .mkString("\n"), + "GH_USER" -> "SystemFw", + "GH_REPO" -> "dynosaur" ), - githubWorkflowArtifactUpload := false, - fatalWarningsInCI := false - ) - .dependsOn(core.jvm) - .enablePlugins(MdocPlugin, NoPublishPlugin) - -ThisBuild / githubWorkflowJavaVersions := Seq(JavaSpec.temurin("11")) - -ThisBuild / githubWorkflowBuildPostamble ++= List( - WorkflowStep.Sbt( - List("docs/mdoc"), - cond = Some(s"matrix.scala == '$Scala213'") + tlFatalWarnings := false ) -) - -ThisBuild / githubWorkflowAddedJobs += WorkflowJob( - id = "docs", - name = "Deploy docs", - needs = List("publish"), - cond = """ - | always() && - | needs.build.result == 'success' && - | (needs.publish.result == 'success' || github.ref == 'refs/heads/docs-deploy') - """.stripMargin.trim.linesIterator.mkString.some, - steps = githubWorkflowGeneratedDownloadSteps.value.toList :+ - WorkflowStep.Use( - UseRef.Public("peaceiris", "actions-gh-pages", "v3"), - name = Some(s"Deploy docs"), - params = Map( - "publish_dir" -> "./target/website", - "github_token" -> "${{ secrets.GITHUB_TOKEN }}" - ) - ), - scalas = List(Scala213), - javas = githubWorkflowJavaVersions.value.toList -) diff --git a/project/build.properties b/project/build.properties index e8a1e24..04267b1 100644 --- a/project/build.properties +++ b/project/build.properties @@ -1 +1 @@ -sbt.version=1.9.7 +sbt.version=1.9.9 diff --git a/project/plugins.sbt b/project/plugins.sbt index 63f0eb3..ffe540c 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -1,6 +1,7 @@ -addSbtPlugin("com.codecommit" % "sbt-spiewak-sonatype" % "0.23.0") -addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.5.2") -addSbtPlugin("org.scalameta" % "sbt-mdoc" % "2.4.0") -addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.19.0") +addSbtPlugin("org.typelevel" % "sbt-typelevel" % "0.7.7") +addSbtPlugin("org.typelevel" % "sbt-typelevel-site" % "0.7.7") +addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.5.4") +addSbtPlugin("org.scalameta" % "sbt-mdoc" % "2.7.1") +addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.18.2") addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "1.3.2") addSbtPlugin("pl.project13.scala" % "sbt-jmh" % "0.4.7")