From b7f1f452f63c782c8f203b58a6c1718aa0407ffa Mon Sep 17 00:00:00 2001 From: Ondra Pelech Date: Sat, 11 May 2024 03:20:33 +0200 Subject: [PATCH 01/23] Scala Native 0.5.x --- .github/workflows/ci.yml | 58 ++++++++++++++++++++-------------------- build.sbt | 10 +++---- project/build.properties | 2 +- project/plugins.sbt | 2 +- 4 files changed, 36 insertions(+), 36 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f1b59c62f..4b28a457e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -28,18 +28,18 @@ jobs: strategy: matrix: os: [ubuntu-latest] - scala: [2.12.17, 2.13.10, 3.2.1] - java: [temurin@11] + scala: [2.12.17, 2.13.10, 3.3.3] + java: [temurin@8] project: [rootJS, rootJVM, rootNative] include: - - scala: 3.2.1 - java: temurin@11 + - scala: 3.3.3 + java: temurin@8 project: rootNative os: macos-latest exclude: - - scala: 3.2.1 + - scala: 3.3.3 project: rootJVM - - scala: 3.2.1 + - scala: 3.3.3 project: rootNative os: ubuntu-latest runs-on: ${{ matrix.os }} @@ -49,21 +49,21 @@ jobs: with: fetch-depth: 0 - - name: Download Java (temurin@11) - id: download-java-temurin-11 - if: matrix.java == 'temurin@11' + - name: Download Java (temurin@8) + id: download-java-temurin-8 + if: matrix.java == 'temurin@8' uses: typelevel/download-java@v1 with: distribution: temurin - java-version: 11 + java-version: 8 - - name: Setup Java (temurin@11) - if: matrix.java == 'temurin@11' + - name: Setup Java (temurin@8) + if: matrix.java == 'temurin@8' uses: actions/setup-java@v2 with: distribution: jdkfile - java-version: 11 - jdkFile: ${{ steps.download-java-temurin-11.outputs.jdkFile }} + java-version: 8 + jdkFile: ${{ steps.download-java-temurin-8.outputs.jdkFile }} - name: Cache sbt uses: actions/cache@v2 @@ -81,7 +81,7 @@ jobs: run: sbt githubWorkflowCheck - name: Check formatting - if: matrix.java == 'temurin@11' + if: matrix.java == 'temurin@8' run: sbt 'project ${{ matrix.project }}' '++ ${{ matrix.scala }}' scalafmtCheckAll 'project /' scalafmtSbtCheck - name: scalaJSLink @@ -96,11 +96,11 @@ jobs: run: sbt 'project ${{ matrix.project }}' '++ ${{ matrix.scala }}' test - name: Check binary compatibility - if: matrix.java == 'temurin@11' + if: matrix.java == 'temurin@8' run: sbt 'project ${{ matrix.project }}' '++ ${{ matrix.scala }}' mimaReportBinaryIssues - name: Generate API documentation - if: matrix.java == 'temurin@11' + if: matrix.java == 'temurin@8' run: sbt 'project ${{ matrix.project }}' '++ ${{ matrix.scala }}' doc - name: Make target directories @@ -126,7 +126,7 @@ jobs: matrix: os: [ubuntu-latest] scala: [2.13.10] - java: [temurin@11] + java: [temurin@8] runs-on: ${{ matrix.os }} steps: - name: Checkout current branch (full) @@ -134,21 +134,21 @@ jobs: with: fetch-depth: 0 - - name: Download Java (temurin@11) - id: download-java-temurin-11 - if: matrix.java == 'temurin@11' + - name: Download Java (temurin@8) + id: download-java-temurin-8 + if: matrix.java == 'temurin@8' uses: typelevel/download-java@v1 with: distribution: temurin - java-version: 11 + java-version: 8 - - name: Setup Java (temurin@11) - if: matrix.java == 'temurin@11' + - name: Setup Java (temurin@8) + if: matrix.java == 'temurin@8' uses: actions/setup-java@v2 with: distribution: jdkfile - java-version: 11 - jdkFile: ${{ steps.download-java-temurin-11.outputs.jdkFile }} + java-version: 8 + jdkFile: ${{ steps.download-java-temurin-8.outputs.jdkFile }} - name: Cache sbt uses: actions/cache@v2 @@ -222,12 +222,12 @@ jobs: tar xf targets.tar rm targets.tar - - name: Download target directories (3.2.1, rootJS) + - name: Download target directories (3.3.3, rootJS) uses: actions/download-artifact@v2 with: - name: target-${{ matrix.os }}-${{ matrix.java }}-3.2.1-rootJS + name: target-${{ matrix.os }}-${{ matrix.java }}-3.3.3-rootJS - - name: Inflate target directories (3.2.1, rootJS) + - name: Inflate target directories (3.3.3, rootJS) run: | tar xf targets.tar rm targets.tar diff --git a/build.sbt b/build.sbt index 74fe2a9b7..3ca85d5ce 100644 --- a/build.sbt +++ b/build.sbt @@ -1,12 +1,12 @@ val scala213 = "2.13.10" -val scala3 = "3.2.1" +val scala3 = "3.3.3" ThisBuild / scalaVersion := scala213 ThisBuild / crossScalaVersions := Seq("2.12.17", scala213, scala3) ThisBuild / tlBaseVersion := "2.5" -val temurin11 = JavaSpec.temurin("11") -ThisBuild / githubWorkflowJavaVersions := Seq(temurin11) +val temurin = JavaSpec.temurin("8") +ThisBuild / githubWorkflowJavaVersions := Seq(temurin) ThisBuild / githubWorkflowBuildMatrixExclusions ++= Seq( MatrixExclude(Map("scala" -> scala3, "project" -> "rootJVM")), // TODO @@ -16,12 +16,12 @@ ThisBuild / githubWorkflowBuildMatrixExclusions ++= Seq( ) ThisBuild / githubWorkflowBuildMatrixInclusions += - MatrixInclude(Map("scala" -> scala3, "java" -> temurin11.render, "project" -> "rootNative"), + MatrixInclude(Map("scala" -> scala3, "java" -> temurin.render, "project" -> "rootNative"), Map("os" -> "macos-latest") ) val tzdbVersion = "2019c" -val scalajavaLocalesVersion = "1.5.1" +val scalajavaLocalesVersion = "1.6.0" Global / onChangedBuildSource := ReloadOnSourceChanges lazy val downloadFromZip: TaskKey[Unit] = diff --git a/project/build.properties b/project/build.properties index 8b9a0b0ab..081fdbbc7 100644 --- a/project/build.properties +++ b/project/build.properties @@ -1 +1 @@ -sbt.version=1.8.0 +sbt.version=1.10.0 diff --git a/project/plugins.sbt b/project/plugins.sbt index 0e1ddfd53..05423fcb3 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -8,4 +8,4 @@ addSbtPlugin("org.typelevel" % "sbt-typelevel" % "0.4.17") addSbtPlugin("org.portable-scala" % "sbt-scala-native-crossproject" % "1.2.0") -addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.4.11") +addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.5.1") From 1d8522fa478d3e3ceffcb52c3f64416f47cd05c5 Mon Sep 17 00:00:00 2001 From: Ondra Pelech Date: Sat, 11 May 2024 03:26:12 +0200 Subject: [PATCH 02/23] portable-scala-reflect 1.1.3 --- build.sbt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sbt b/build.sbt index 3ca85d5ce..7839c6e6b 100644 --- a/build.sbt +++ b/build.sbt @@ -140,7 +140,7 @@ lazy val core = crossProject(JVMPlatform, JSPlatform, NativePlatform) .settings(commonSettings) .settings( name := "scala-java-time", - libraryDependencies += ("org.portable-scala" %%% "portable-scala-reflect" % "1.1.2") + libraryDependencies += ("org.portable-scala" %%% "portable-scala-reflect" % "1.1.3") .cross(CrossVersion.for3Use2_13) ) .jsSettings( From 63d856a4dfb70ba7956377941ad3f640f8d6cfd8 Mon Sep 17 00:00:00 2001 From: Ondra Pelech Date: Mon, 20 May 2024 01:07:25 +0200 Subject: [PATCH 03/23] Scala Native 0.5.x --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e5690b892..3e668fa74 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -252,5 +252,5 @@ jobs: - name: Submit Dependencies uses: scalacenter/sbt-dependency-submission@v2 with: - modules-ignore: rootjs_2.12 rootjs_2.13 rootjs_3 tests_sjs1_2.12 tests_sjs1_2.13 tests_sjs1_3 rootjvm_2.12 rootjvm_2.13 rootjvm_3 rootnative_2.12 rootnative_2.13 rootnative_3 demo_2.12 demo_2.13 demo_3 tests_2.12 tests_2.13 tests_3 demo_native0.4_2.12 demo_native0.4_2.13 demo_native0.4_3 tests_native0.4_2.12 tests_native0.4_2.13 tests_native0.4_3 demo_sjs1_2.12 demo_sjs1_2.13 demo_sjs1_3 + modules-ignore: rootjs_2.12 rootjs_2.13 rootjs_3 tests_sjs1_2.12 tests_sjs1_2.13 tests_sjs1_3 rootjvm_2.12 rootjvm_2.13 rootjvm_3 rootnative_2.12 rootnative_2.13 rootnative_3 demo_2.12 demo_2.13 demo_3 tests_2.12 tests_2.13 tests_3 demo_native0.5_2.12 demo_native0.5_2.13 demo_native0.5_3 tests_native0.5_2.12 tests_native0.5_2.13 tests_native0.5_3 demo_sjs1_2.12 demo_sjs1_2.13 demo_sjs1_3 configs-ignore: test scala-tool scala-doc-tool test-internal From 561cff03d523094e764d46f2a17bb24d26091e85 Mon Sep 17 00:00:00 2001 From: Ondra Pelech Date: Fri, 31 May 2024 22:46:30 +0200 Subject: [PATCH 04/23] Scala Native 0.5.x --- build.sbt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build.sbt b/build.sbt index a110909fb..154617bdc 100644 --- a/build.sbt +++ b/build.sbt @@ -23,7 +23,7 @@ ThisBuild / githubWorkflowBuildMatrixInclusions += ) val tzdbVersion = "2019c" -val scalajavaLocalesVersion = "1.6.0" +val scalajavaLocalesVersion = "1.5.4" Global / onChangedBuildSource := ReloadOnSourceChanges lazy val downloadFromZip: TaskKey[Unit] = @@ -209,7 +209,7 @@ lazy val tests = crossProject(JVMPlatform, JSPlatform, NativePlatform) name := "tests", Keys.`package` := file(""), libraryDependencies += - "org.scalatest" %%% "scalatest" % "3.2.14" % Test, + "org.scalatest" %%% "scalatest" % "3.2.18" % Test, scalacOptions ~= (_.filterNot( Set("-Wnumeric-widen", "-Ywarn-numeric-widen", "-Ywarn-value-discard", "-Wvalue-discard") )) From 245e500575b5df3f1e55612d757bfe79f98eec1a Mon Sep 17 00:00:00 2001 From: Ondra Pelech Date: Fri, 31 May 2024 22:51:44 +0200 Subject: [PATCH 05/23] -P:scalanative:genStaticForwardersForNonTopLevelObjects --- build.sbt | 1 + 1 file changed, 1 insertion(+) diff --git a/build.sbt b/build.sbt index 154617bdc..1abe13917 100644 --- a/build.sbt +++ b/build.sbt @@ -160,6 +160,7 @@ lazy val core = crossProject(JVMPlatform, JSPlatform, NativePlatform) ) ) .nativeSettings( + scalacOptions += "-P:scalanative:genStaticForwardersForNonTopLevelObjects", Compile / sourceGenerators += Def.task { val srcDirs = (Compile / sourceDirectories).value val destinationDir = (Compile / sourceManaged).value From a369888b3190d09bc04c8759c5ca314678463769 Mon Sep 17 00:00:00 2001 From: Ondra Pelech Date: Fri, 31 May 2024 23:09:03 +0200 Subject: [PATCH 06/23] Global / concurrentRestrictions += Tags.limit(NativeTags.Link, 1) --- build.sbt | 1 + 1 file changed, 1 insertion(+) diff --git a/build.sbt b/build.sbt index 1abe13917..499924871 100644 --- a/build.sbt +++ b/build.sbt @@ -25,6 +25,7 @@ ThisBuild / githubWorkflowBuildMatrixInclusions += val tzdbVersion = "2019c" val scalajavaLocalesVersion = "1.5.4" Global / onChangedBuildSource := ReloadOnSourceChanges +Global / concurrentRestrictions += Tags.limit(NativeTags.Link, 1) lazy val downloadFromZip: TaskKey[Unit] = taskKey[Unit]("Download the tzdb tarball and extract it") From 248cccabd48869e9d32122c4fab828e398e7acee Mon Sep 17 00:00:00 2001 From: Ondra Pelech Date: Sat, 1 Jun 2024 01:03:39 +0200 Subject: [PATCH 07/23] set-swap-space --- .github/workflows/ci.yml | 194 ++++++------------------------------ .github/workflows/clean.yml | 3 +- build.sbt | 70 ++++++------- project/plugins.sbt | 3 +- 4 files changed, 69 insertions(+), 201 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3e668fa74..00a023bd8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,49 +9,33 @@ name: Continuous Integration on: pull_request: - branches: ['**', '!update/**', '!pr/**'] + branches: ['**'] push: - branches: ['**', '!update/**', '!pr/**'] - tags: [v*] + branches: ['**'] env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - -concurrency: - group: ${{ github.workflow }} @ ${{ github.ref }} - cancel-in-progress: true - jobs: build: name: Build and Test strategy: matrix: os: [ubuntu-latest] - scala: [2.12, 2.13, 3] + scala: [2.12.17, 2.13.14, 3.3.3] java: [corretto@11] - project: [rootJS, rootJVM, rootNative] - include: - - scala: 3 - java: corretto@11 - project: rootNative - os: macos-latest - exclude: - - scala: 3 - project: rootJVM - - scala: 3 - project: rootNative - os: ubuntu-latest runs-on: ${{ matrix.os }} - timeout-minutes: 60 steps: + - uses: pierotofy/set-swap-space@master + with: + swap-size-gb: 5 + - name: Checkout current branch (full) uses: actions/checkout@v4 with: fetch-depth: 0 - name: Setup Java (corretto@11) - id: setup-java-corretto-11 if: matrix.java == 'corretto@11' uses: actions/setup-java@v4 with: @@ -59,64 +43,42 @@ jobs: java-version: 11 cache: sbt - - name: sbt update - if: matrix.java == 'corretto@11' && steps.setup-java-corretto-11.outputs.cache-hit == 'false' - run: ./sbt +update - - name: Check that workflows are up to date - run: ./sbt githubWorkflowCheck - - - name: scalaJSLink - if: matrix.project == 'rootJS' - run: ./sbt 'project ${{ matrix.project }}' '++ ${{ matrix.scala }}' Test/scalaJSLinkerResult - - - name: nativeLink - if: matrix.project == 'rootNative' - run: ./sbt 'project ${{ matrix.project }}' '++ ${{ matrix.scala }}' Test/nativeLink - - - name: Test - run: ./sbt 'project ${{ matrix.project }}' '++ ${{ matrix.scala }}' test - - - name: Check binary compatibility - if: matrix.java == 'corretto@11' && matrix.os == 'ubuntu-latest' - run: ./sbt 'project ${{ matrix.project }}' '++ ${{ matrix.scala }}' mimaReportBinaryIssues + run: ./sbt '++ ${{ matrix.scala }}' githubWorkflowCheck - - name: Generate API documentation - if: matrix.java == 'corretto@11' && matrix.os == 'ubuntu-latest' - run: ./sbt 'project ${{ matrix.project }}' '++ ${{ matrix.scala }}' doc - - - name: Make target directories - if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/master') - run: mkdir -p core/native/target tzdb/js/target core/js/target core/jvm/target tzdb/jvm/target tzdb/native/target project/target + - name: Build project + run: ./sbt '++ ${{ matrix.scala }}' test - name: Compress target directories - if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/master') - run: tar cf targets.tar core/native/target tzdb/js/target core/js/target core/jvm/target tzdb/jvm/target tzdb/native/target project/target + run: tar cf targets.tar target core/native/target tzdb/js/target core/js/target core/jvm/target tests/js/target demo/jvm/target tests/jvm/target demo/native/target tzdb/jvm/target tzdb/native/target tests/native/target demo/js/target project/target - name: Upload target directories - if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/master') uses: actions/upload-artifact@v4 with: - name: target-${{ matrix.os }}-${{ matrix.java }}-${{ matrix.scala }}-${{ matrix.project }} + 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') || github.ref == 'refs/heads/master') + if: github.event_name != 'pull_request' && (github.ref == 'refs/heads/main') strategy: matrix: os: [ubuntu-latest] + scala: [2.13.14] java: [corretto@11] runs-on: ${{ matrix.os }} steps: + - uses: pierotofy/set-swap-space@master + with: + swap-size-gb: 5 + - name: Checkout current branch (full) uses: actions/checkout@v4 with: fetch-depth: 0 - name: Setup Java (corretto@11) - id: setup-java-corretto-11 if: matrix.java == 'corretto@11' uses: actions/setup-java@v4 with: @@ -124,133 +86,35 @@ jobs: java-version: 11 cache: sbt - - name: sbt update - if: matrix.java == 'corretto@11' && steps.setup-java-corretto-11.outputs.cache-hit == 'false' - run: ./sbt +update - - - name: Download target directories (2.12, rootJS) - uses: actions/download-artifact@v4 - with: - name: target-${{ matrix.os }}-${{ matrix.java }}-2.12-rootJS - - - name: Inflate target directories (2.12, rootJS) - run: | - tar xf targets.tar - rm targets.tar - - - name: Download target directories (2.12, rootJVM) - uses: actions/download-artifact@v4 - with: - name: target-${{ matrix.os }}-${{ matrix.java }}-2.12-rootJVM - - - name: Inflate target directories (2.12, rootJVM) - run: | - tar xf targets.tar - rm targets.tar - - - name: Download target directories (2.12, rootNative) - uses: actions/download-artifact@v4 - with: - name: target-${{ matrix.os }}-${{ matrix.java }}-2.12-rootNative - - - name: Inflate target directories (2.12, rootNative) - run: | - tar xf targets.tar - rm targets.tar - - - name: Download target directories (2.13, rootJS) + - name: Download target directories (2.12.17) uses: actions/download-artifact@v4 with: - name: target-${{ matrix.os }}-${{ matrix.java }}-2.13-rootJS + name: target-${{ matrix.os }}-2.12.17-${{ matrix.java }} - - name: Inflate target directories (2.13, rootJS) + - name: Inflate target directories (2.12.17) run: | tar xf targets.tar rm targets.tar - - name: Download target directories (2.13, rootJVM) + - name: Download target directories (2.13.14) uses: actions/download-artifact@v4 with: - name: target-${{ matrix.os }}-${{ matrix.java }}-2.13-rootJVM + name: target-${{ matrix.os }}-2.13.14-${{ matrix.java }} - - name: Inflate target directories (2.13, rootJVM) + - name: Inflate target directories (2.13.14) run: | tar xf targets.tar rm targets.tar - - name: Download target directories (2.13, rootNative) + - name: Download target directories (3.3.3) uses: actions/download-artifact@v4 with: - name: target-${{ matrix.os }}-${{ matrix.java }}-2.13-rootNative + name: target-${{ matrix.os }}-3.3.3-${{ matrix.java }} - - name: Inflate target directories (2.13, rootNative) + - name: Inflate target directories (3.3.3) run: | tar xf targets.tar rm targets.tar - - name: Download target directories (3, rootJS) - uses: actions/download-artifact@v4 - with: - name: target-${{ matrix.os }}-${{ matrix.java }}-3-rootJS - - - name: Inflate target directories (3, rootJS) - run: | - tar xf targets.tar - rm targets.tar - - - name: Import signing key - if: env.PGP_SECRET != '' && env.PGP_PASSPHRASE == '' - env: - PGP_SECRET: ${{ secrets.PGP_SECRET }} - PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }} - run: echo $PGP_SECRET | base64 -d -i - | gpg --import - - - name: Import signing key and strip passphrase - if: env.PGP_SECRET != '' && env.PGP_PASSPHRASE != '' - env: - PGP_SECRET: ${{ secrets.PGP_SECRET }} - PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }} - run: | - echo "$PGP_SECRET" | base64 -d -i - > /tmp/signing-key.gpg - echo "$PGP_PASSPHRASE" | gpg --pinentry-mode loopback --passphrase-fd 0 --import /tmp/signing-key.gpg - (echo "$PGP_PASSPHRASE"; echo; echo) | gpg --command-fd 0 --pinentry-mode loopback --change-passphrase $(gpg --list-secret-keys --with-colons 2> /dev/null | grep '^sec:' | cut --delimiter ':' --fields 5 | tail -n 1) - - - name: Publish - env: - SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} - SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} - SONATYPE_CREDENTIAL_HOST: ${{ secrets.SONATYPE_CREDENTIAL_HOST }} - run: ./sbt tlCiRelease - - dependency-submission: - name: Submit Dependencies - if: github.event_name != 'pull_request' - strategy: - matrix: - os: [ubuntu-latest] - java: [corretto@11] - runs-on: ${{ matrix.os }} - steps: - - name: Checkout current branch (full) - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Setup Java (corretto@11) - id: setup-java-corretto-11 - if: matrix.java == 'corretto@11' - uses: actions/setup-java@v4 - with: - distribution: corretto - java-version: 11 - cache: sbt - - - name: sbt update - if: matrix.java == 'corretto@11' && steps.setup-java-corretto-11.outputs.cache-hit == 'false' - run: ./sbt +update - - - name: Submit Dependencies - uses: scalacenter/sbt-dependency-submission@v2 - with: - modules-ignore: rootjs_2.12 rootjs_2.13 rootjs_3 tests_sjs1_2.12 tests_sjs1_2.13 tests_sjs1_3 rootjvm_2.12 rootjvm_2.13 rootjvm_3 rootnative_2.12 rootnative_2.13 rootnative_3 demo_2.12 demo_2.13 demo_3 tests_2.12 tests_2.13 tests_3 demo_native0.5_2.12 demo_native0.5_2.13 demo_native0.5_3 tests_native0.5_2.12 tests_native0.5_2.13 tests_native0.5_3 demo_sjs1_2.12 demo_sjs1_2.13 demo_sjs1_3 - configs-ignore: test scala-tool scala-doc-tool test-internal + - name: Publish project + run: ./sbt +publish diff --git a/.github/workflows/clean.yml b/.github/workflows/clean.yml index 547aaa43e..bfc865d50 100644 --- a/.github/workflows/clean.yml +++ b/.github/workflows/clean.yml @@ -17,6 +17,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} steps: - name: Delete artifacts + shell: bash {0} run: | # Customize those three lines with your repository and credentials: REPO=${GITHUB_API_URL}/repos/${{ github.repository }} @@ -25,7 +26,7 @@ jobs: ghapi() { curl --silent --location --user _:$GITHUB_TOKEN "$@"; } # A temporary file which receives HTTP response headers. - TMPFILE=/tmp/tmp.$$ + TMPFILE=$(mktemp) # An associative array, key: artifact name, value: number of artifacts of that name. declare -A ARTCOUNT diff --git a/build.sbt b/build.sbt index 499924871..27dc2f612 100644 --- a/build.sbt +++ b/build.sbt @@ -3,25 +3,22 @@ val scala3 = "3.3.3" ThisBuild / scalaVersion := scala213 ThisBuild / crossScalaVersions := Seq("2.12.17", scala213, scala3) -ThisBuild / tlBaseVersion := "2.5" +ThisBuild / githubWorkflowGeneratedCI ~= { + _.map(wj => + wj.copy( + steps = WorkflowStep.Use( + ref = UseRef.Public("pierotofy", "set-swap-space", "master"), + params = Map("swap-size-gb" -> "5") + ) +: wj.steps + ) + ) +} val javaDistro = JavaSpec.corretto("11") ThisBuild / githubWorkflowJavaVersions := Seq(javaDistro) ThisBuild / githubWorkflowSbtCommand := "./sbt" -ThisBuild / githubWorkflowBuildMatrixExclusions ++= Seq( - MatrixExclude(Map("scala" -> "3", "project" -> "rootJVM")), // TODO - MatrixExclude( - Map("scala" -> "3", "project" -> "rootNative", "os" -> "ubuntu-latest") - ) // run on macOS instead -) - -ThisBuild / githubWorkflowBuildMatrixInclusions += - MatrixInclude(Map("scala" -> "3", "java" -> javaDistro.render, "project" -> "rootNative"), - Map("os" -> "macos-latest") - ) - val tzdbVersion = "2019c" val scalajavaLocalesVersion = "1.5.4" Global / onChangedBuildSource := ReloadOnSourceChanges @@ -32,23 +29,27 @@ lazy val downloadFromZip: TaskKey[Unit] = inThisBuild( List( - organization := "io.github.cquiroz", - licenses := Seq("BSD 3-Clause License" -> url("https://opensource.org/licenses/BSD-3-Clause")), - developers := List( + organization := "io.github.cquiroz", + licenses := Seq("BSD 3-Clause License" -> url("https://opensource.org/licenses/BSD-3-Clause")), + developers := List( Developer("cquiroz", "Carlos Quiroz", "carlos.m.quiroz@gmail.com", url("https://github.com/cquiroz") ) - ), - tlSonatypeUseLegacyHost := true, - tlMimaPreviousVersions := Set(), - tlCiReleaseBranches := Seq("master"), - tlCiHeaderCheck := false + ) ) ) -lazy val root = tlCrossRootProject.aggregate(core, tzdb, tests, demo) +lazy val projects = List(core, tzdb, tests, demo) + +lazy val root = project + .in(file(".")) + .settings(commonSettings) + .settings( + publish / skip := true + ) + .aggregate(projects.flatMap(p => List[ProjectReference](p.jvm, p.js, p.native)): _*) lazy val commonSettings = Seq( description := "java.time API implementation in Scala and Scala.js", @@ -77,7 +78,7 @@ lazy val commonSettings = Seq( } }, scalacOptions --= { - if (tlIsScala3.value) + if (scalaVersion.value == scala3) List( "-Xfatal-warnings", "-source:3.0-migration" @@ -148,7 +149,7 @@ lazy val core = crossProject(JVMPlatform, JSPlatform, NativePlatform) ) .jsSettings( scalacOptions ++= { - if (tlIsScala3.value) Seq("-scalajs-genStaticForwardersForNonTopLevelObjects") + if (scalaVersion.value == scala3) Seq("-scalajs-genStaticForwardersForNonTopLevelObjects") else Seq("-P:scalajs:genStaticForwardersForNonTopLevelObjects") }, Compile / sourceGenerators += Def.task { @@ -177,9 +178,9 @@ lazy val tzdb = crossProject(JVMPlatform, JSPlatform, NativePlatform) .in(file("tzdb")) .settings(commonSettings) .settings( - name := "scala-java-time-tzdb", - includeTTBP := true, - dbVersion := TzdbPlugin.Version(tzdbVersion), + name := "scala-java-time-tzdb", + includeTTBP := true, + dbVersion := TzdbPlugin.Version(tzdbVersion) ) .jsSettings( Compile / sourceGenerators += Def.task { @@ -205,10 +206,10 @@ lazy val tzdb = crossProject(JVMPlatform, JSPlatform, NativePlatform) lazy val tests = crossProject(JVMPlatform, JSPlatform, NativePlatform) .crossType(CrossType.Full) .in(file("tests")) - .enablePlugins(NoPublishPlugin) .settings(commonSettings) .settings( name := "tests", + publish / skip := true, Keys.`package` := file(""), libraryDependencies += "org.scalatest" %%% "scalatest" % "3.2.18" % Test, @@ -246,14 +247,15 @@ val zonesFilterFn = (x: String) => x == "Europe/Helsinki" || x == "America/Santi lazy val demo = crossProject(JSPlatform, JVMPlatform, NativePlatform) .in(file("demo")) .dependsOn(core) - .enablePlugins(TzdbPlugin, NoPublishPlugin) + .enablePlugins(TzdbPlugin) .settings( - name := "demo", - Keys.`package` := file(""), - zonesFilter := zonesFilterFn, - dbVersion := TzdbPlugin.Version(tzdbVersion), + name := "demo", + publish / skip := true, + Keys.`package` := file(""), + zonesFilter := zonesFilterFn, + dbVersion := TzdbPlugin.Version(tzdbVersion), // delegate test to run, so that it is invoked during test step in ci - Test / test := (Compile / run).toTask("").value + Test / test := (Compile / run).toTask("").value ) .jsSettings( scalaJSUseMainModuleInitializer := true diff --git a/project/plugins.sbt b/project/plugins.sbt index 582cbb3d4..0cb43037e 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -4,7 +4,8 @@ addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.16.0") addSbtPlugin("io.github.cquiroz" % "sbt-tzdb" % "4.2.0") -addSbtPlugin("org.typelevel" % "sbt-typelevel-ci-release" % "0.7.1") +addSbtPlugin("com.github.sbt" % "sbt-github-actions" % "0.23.0") +addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.5.12") addSbtPlugin("org.portable-scala" % "sbt-scala-native-crossproject" % "1.3.2") From 5cba4eb5d57240c81cc54d65eb0ac6fbe69948a6 Mon Sep 17 00:00:00 2001 From: Ondra Pelech Date: Sat, 1 Jun 2024 01:13:31 +0200 Subject: [PATCH 08/23] MatrixExclude(Map("scala" -> scala3)) --- .github/workflows/ci.yml | 6 ++++-- build.sbt | 6 +++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 00a023bd8..6a3d00974 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,11 +24,13 @@ jobs: os: [ubuntu-latest] scala: [2.12.17, 2.13.14, 3.3.3] java: [corretto@11] + exclude: + - scala: 3.3.3 runs-on: ${{ matrix.os }} steps: - uses: pierotofy/set-swap-space@master with: - swap-size-gb: 5 + swap-size-gb: 7 - name: Checkout current branch (full) uses: actions/checkout@v4 @@ -71,7 +73,7 @@ jobs: steps: - uses: pierotofy/set-swap-space@master with: - swap-size-gb: 5 + swap-size-gb: 7 - name: Checkout current branch (full) uses: actions/checkout@v4 diff --git a/build.sbt b/build.sbt index 27dc2f612..66f074fc7 100644 --- a/build.sbt +++ b/build.sbt @@ -8,7 +8,7 @@ ThisBuild / githubWorkflowGeneratedCI ~= { wj.copy( steps = WorkflowStep.Use( ref = UseRef.Public("pierotofy", "set-swap-space", "master"), - params = Map("swap-size-gb" -> "5") + params = Map("swap-size-gb" -> "7") ) +: wj.steps ) ) @@ -19,6 +19,10 @@ ThisBuild / githubWorkflowJavaVersions := Seq(javaDistro) ThisBuild / githubWorkflowSbtCommand := "./sbt" +ThisBuild / githubWorkflowBuildMatrixExclusions ++= Seq( + MatrixExclude(Map("scala" -> scala3)) // TODO +) + val tzdbVersion = "2019c" val scalajavaLocalesVersion = "1.5.4" Global / onChangedBuildSource := ReloadOnSourceChanges From 205f23b4329fb5c05235d092536a82010509f409 Mon Sep 17 00:00:00 2001 From: Ondra Pelech Date: Sat, 1 Jun 2024 01:23:40 +0200 Subject: [PATCH 09/23] -Xmx6g --- .github/workflows/ci.yml | 2 -- .jvmopts | 2 +- build.sbt | 10 +++++----- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6a3d00974..303a07a6a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,8 +24,6 @@ jobs: os: [ubuntu-latest] scala: [2.12.17, 2.13.14, 3.3.3] java: [corretto@11] - exclude: - - scala: 3.3.3 runs-on: ${{ matrix.os }} steps: - uses: pierotofy/set-swap-space@master diff --git a/.jvmopts b/.jvmopts index e24c9fe86..1fdcaa061 100644 --- a/.jvmopts +++ b/.jvmopts @@ -1,4 +1,4 @@ --Xmx4g +-Xmx6g -Xss4m -XX:MaxMetaspaceSize=1g -XX:ReservedCodeCacheSize=512m diff --git a/build.sbt b/build.sbt index 66f074fc7..a1ff6bf53 100644 --- a/build.sbt +++ b/build.sbt @@ -19,10 +19,6 @@ ThisBuild / githubWorkflowJavaVersions := Seq(javaDistro) ThisBuild / githubWorkflowSbtCommand := "./sbt" -ThisBuild / githubWorkflowBuildMatrixExclusions ++= Seq( - MatrixExclude(Map("scala" -> scala3)) // TODO -) - val tzdbVersion = "2019c" val scalajavaLocalesVersion = "1.5.4" Global / onChangedBuildSource := ReloadOnSourceChanges @@ -219,7 +215,11 @@ lazy val tests = crossProject(JVMPlatform, JSPlatform, NativePlatform) "org.scalatest" %%% "scalatest" % "3.2.18" % Test, scalacOptions ~= (_.filterNot( Set("-Wnumeric-widen", "-Ywarn-numeric-widen", "-Ywarn-value-discard", "-Wvalue-discard") - )) + )), + Test / test := { + if (scalaVersion.value == scala3) { (Test / compile).value } + else { (Test / test).value } + } ) .jvmSettings( // Fork the JVM test to ensure that the custom flags are set From 1830f65ea3131a39433368118d318a892fd83064 Mon Sep 17 00:00:00 2001 From: Ondra Pelech Date: Sat, 1 Jun 2024 01:35:16 +0200 Subject: [PATCH 10/23] Revert "-Xmx6g" This reverts commit 205f23b4329fb5c05235d092536a82010509f409. --- .github/workflows/ci.yml | 2 ++ .jvmopts | 2 +- build.sbt | 10 +++++----- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 303a07a6a..6a3d00974 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,6 +24,8 @@ jobs: os: [ubuntu-latest] scala: [2.12.17, 2.13.14, 3.3.3] java: [corretto@11] + exclude: + - scala: 3.3.3 runs-on: ${{ matrix.os }} steps: - uses: pierotofy/set-swap-space@master diff --git a/.jvmopts b/.jvmopts index 1fdcaa061..e24c9fe86 100644 --- a/.jvmopts +++ b/.jvmopts @@ -1,4 +1,4 @@ --Xmx6g +-Xmx4g -Xss4m -XX:MaxMetaspaceSize=1g -XX:ReservedCodeCacheSize=512m diff --git a/build.sbt b/build.sbt index a1ff6bf53..66f074fc7 100644 --- a/build.sbt +++ b/build.sbt @@ -19,6 +19,10 @@ ThisBuild / githubWorkflowJavaVersions := Seq(javaDistro) ThisBuild / githubWorkflowSbtCommand := "./sbt" +ThisBuild / githubWorkflowBuildMatrixExclusions ++= Seq( + MatrixExclude(Map("scala" -> scala3)) // TODO +) + val tzdbVersion = "2019c" val scalajavaLocalesVersion = "1.5.4" Global / onChangedBuildSource := ReloadOnSourceChanges @@ -215,11 +219,7 @@ lazy val tests = crossProject(JVMPlatform, JSPlatform, NativePlatform) "org.scalatest" %%% "scalatest" % "3.2.18" % Test, scalacOptions ~= (_.filterNot( Set("-Wnumeric-widen", "-Ywarn-numeric-widen", "-Ywarn-value-discard", "-Wvalue-discard") - )), - Test / test := { - if (scalaVersion.value == scala3) { (Test / compile).value } - else { (Test / test).value } - } + )) ) .jvmSettings( // Fork the JVM test to ensure that the custom flags are set From b3c589b766871611457a6773ac7708df5b279bd5 Mon Sep 17 00:00:00 2001 From: Ondra Pelech Date: Sat, 1 Jun 2024 01:35:23 +0200 Subject: [PATCH 11/23] Revert "MatrixExclude(Map("scala" -> scala3))" This reverts commit 5cba4eb5d57240c81cc54d65eb0ac6fbe69948a6. --- .github/workflows/ci.yml | 6 ++---- build.sbt | 6 +----- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6a3d00974..00a023bd8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,13 +24,11 @@ jobs: os: [ubuntu-latest] scala: [2.12.17, 2.13.14, 3.3.3] java: [corretto@11] - exclude: - - scala: 3.3.3 runs-on: ${{ matrix.os }} steps: - uses: pierotofy/set-swap-space@master with: - swap-size-gb: 7 + swap-size-gb: 5 - name: Checkout current branch (full) uses: actions/checkout@v4 @@ -73,7 +71,7 @@ jobs: steps: - uses: pierotofy/set-swap-space@master with: - swap-size-gb: 7 + swap-size-gb: 5 - name: Checkout current branch (full) uses: actions/checkout@v4 diff --git a/build.sbt b/build.sbt index 66f074fc7..27dc2f612 100644 --- a/build.sbt +++ b/build.sbt @@ -8,7 +8,7 @@ ThisBuild / githubWorkflowGeneratedCI ~= { wj.copy( steps = WorkflowStep.Use( ref = UseRef.Public("pierotofy", "set-swap-space", "master"), - params = Map("swap-size-gb" -> "7") + params = Map("swap-size-gb" -> "5") ) +: wj.steps ) ) @@ -19,10 +19,6 @@ ThisBuild / githubWorkflowJavaVersions := Seq(javaDistro) ThisBuild / githubWorkflowSbtCommand := "./sbt" -ThisBuild / githubWorkflowBuildMatrixExclusions ++= Seq( - MatrixExclude(Map("scala" -> scala3)) // TODO -) - val tzdbVersion = "2019c" val scalajavaLocalesVersion = "1.5.4" Global / onChangedBuildSource := ReloadOnSourceChanges From abdea6d4ef8f7344d736d4da789326bba497a538 Mon Sep 17 00:00:00 2001 From: Ondra Pelech Date: Sat, 1 Jun 2024 01:35:28 +0200 Subject: [PATCH 12/23] Revert "set-swap-space" This reverts commit 248cccabd48869e9d32122c4fab828e398e7acee. --- .github/workflows/ci.yml | 194 ++++++++++++++++++++++++++++++------ .github/workflows/clean.yml | 3 +- build.sbt | 70 +++++++------ project/plugins.sbt | 3 +- 4 files changed, 201 insertions(+), 69 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 00a023bd8..3e668fa74 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,33 +9,49 @@ name: Continuous Integration on: pull_request: - branches: ['**'] + branches: ['**', '!update/**', '!pr/**'] push: - branches: ['**'] + branches: ['**', '!update/**', '!pr/**'] + tags: [v*] env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + +concurrency: + group: ${{ github.workflow }} @ ${{ github.ref }} + cancel-in-progress: true + jobs: build: name: Build and Test strategy: matrix: os: [ubuntu-latest] - scala: [2.12.17, 2.13.14, 3.3.3] + scala: [2.12, 2.13, 3] java: [corretto@11] + project: [rootJS, rootJVM, rootNative] + include: + - scala: 3 + java: corretto@11 + project: rootNative + os: macos-latest + exclude: + - scala: 3 + project: rootJVM + - scala: 3 + project: rootNative + os: ubuntu-latest runs-on: ${{ matrix.os }} + timeout-minutes: 60 steps: - - uses: pierotofy/set-swap-space@master - with: - swap-size-gb: 5 - - name: Checkout current branch (full) uses: actions/checkout@v4 with: fetch-depth: 0 - name: Setup Java (corretto@11) + id: setup-java-corretto-11 if: matrix.java == 'corretto@11' uses: actions/setup-java@v4 with: @@ -43,42 +59,64 @@ jobs: java-version: 11 cache: sbt + - name: sbt update + if: matrix.java == 'corretto@11' && steps.setup-java-corretto-11.outputs.cache-hit == 'false' + run: ./sbt +update + - name: Check that workflows are up to date - run: ./sbt '++ ${{ matrix.scala }}' githubWorkflowCheck + run: ./sbt githubWorkflowCheck + + - name: scalaJSLink + if: matrix.project == 'rootJS' + run: ./sbt 'project ${{ matrix.project }}' '++ ${{ matrix.scala }}' Test/scalaJSLinkerResult + + - name: nativeLink + if: matrix.project == 'rootNative' + run: ./sbt 'project ${{ matrix.project }}' '++ ${{ matrix.scala }}' Test/nativeLink + + - name: Test + run: ./sbt 'project ${{ matrix.project }}' '++ ${{ matrix.scala }}' test + + - name: Check binary compatibility + if: matrix.java == 'corretto@11' && matrix.os == 'ubuntu-latest' + run: ./sbt 'project ${{ matrix.project }}' '++ ${{ matrix.scala }}' mimaReportBinaryIssues - - name: Build project - run: ./sbt '++ ${{ matrix.scala }}' test + - name: Generate API documentation + if: matrix.java == 'corretto@11' && matrix.os == 'ubuntu-latest' + run: ./sbt 'project ${{ matrix.project }}' '++ ${{ matrix.scala }}' doc + + - name: Make target directories + if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/master') + run: mkdir -p core/native/target tzdb/js/target core/js/target core/jvm/target tzdb/jvm/target tzdb/native/target project/target - name: Compress target directories - run: tar cf targets.tar target core/native/target tzdb/js/target core/js/target core/jvm/target tests/js/target demo/jvm/target tests/jvm/target demo/native/target tzdb/jvm/target tzdb/native/target tests/native/target demo/js/target project/target + if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/master') + run: tar cf targets.tar core/native/target tzdb/js/target core/js/target core/jvm/target tzdb/jvm/target tzdb/native/target project/target - name: Upload target directories + if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/master') uses: actions/upload-artifact@v4 with: - name: target-${{ matrix.os }}-${{ matrix.scala }}-${{ matrix.java }} + name: target-${{ matrix.os }}-${{ matrix.java }}-${{ matrix.scala }}-${{ matrix.project }} path: targets.tar publish: name: Publish Artifacts needs: [build] - if: github.event_name != 'pull_request' && (github.ref == 'refs/heads/main') + if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/master') strategy: matrix: os: [ubuntu-latest] - scala: [2.13.14] java: [corretto@11] runs-on: ${{ matrix.os }} steps: - - uses: pierotofy/set-swap-space@master - with: - swap-size-gb: 5 - - name: Checkout current branch (full) uses: actions/checkout@v4 with: fetch-depth: 0 - name: Setup Java (corretto@11) + id: setup-java-corretto-11 if: matrix.java == 'corretto@11' uses: actions/setup-java@v4 with: @@ -86,35 +124,133 @@ jobs: java-version: 11 cache: sbt - - name: Download target directories (2.12.17) + - name: sbt update + if: matrix.java == 'corretto@11' && steps.setup-java-corretto-11.outputs.cache-hit == 'false' + run: ./sbt +update + + - name: Download target directories (2.12, rootJS) + uses: actions/download-artifact@v4 + with: + name: target-${{ matrix.os }}-${{ matrix.java }}-2.12-rootJS + + - name: Inflate target directories (2.12, rootJS) + run: | + tar xf targets.tar + rm targets.tar + + - name: Download target directories (2.12, rootJVM) + uses: actions/download-artifact@v4 + with: + name: target-${{ matrix.os }}-${{ matrix.java }}-2.12-rootJVM + + - name: Inflate target directories (2.12, rootJVM) + run: | + tar xf targets.tar + rm targets.tar + + - name: Download target directories (2.12, rootNative) + uses: actions/download-artifact@v4 + with: + name: target-${{ matrix.os }}-${{ matrix.java }}-2.12-rootNative + + - name: Inflate target directories (2.12, rootNative) + run: | + tar xf targets.tar + rm targets.tar + + - name: Download target directories (2.13, rootJS) uses: actions/download-artifact@v4 with: - name: target-${{ matrix.os }}-2.12.17-${{ matrix.java }} + name: target-${{ matrix.os }}-${{ matrix.java }}-2.13-rootJS - - name: Inflate target directories (2.12.17) + - name: Inflate target directories (2.13, rootJS) run: | tar xf targets.tar rm targets.tar - - name: Download target directories (2.13.14) + - name: Download target directories (2.13, rootJVM) uses: actions/download-artifact@v4 with: - name: target-${{ matrix.os }}-2.13.14-${{ matrix.java }} + name: target-${{ matrix.os }}-${{ matrix.java }}-2.13-rootJVM - - name: Inflate target directories (2.13.14) + - name: Inflate target directories (2.13, rootJVM) run: | tar xf targets.tar rm targets.tar - - name: Download target directories (3.3.3) + - name: Download target directories (2.13, rootNative) uses: actions/download-artifact@v4 with: - name: target-${{ matrix.os }}-3.3.3-${{ matrix.java }} + name: target-${{ matrix.os }}-${{ matrix.java }}-2.13-rootNative - - name: Inflate target directories (3.3.3) + - name: Inflate target directories (2.13, rootNative) run: | tar xf targets.tar rm targets.tar - - name: Publish project - run: ./sbt +publish + - name: Download target directories (3, rootJS) + uses: actions/download-artifact@v4 + with: + name: target-${{ matrix.os }}-${{ matrix.java }}-3-rootJS + + - name: Inflate target directories (3, rootJS) + run: | + tar xf targets.tar + rm targets.tar + + - name: Import signing key + if: env.PGP_SECRET != '' && env.PGP_PASSPHRASE == '' + env: + PGP_SECRET: ${{ secrets.PGP_SECRET }} + PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }} + run: echo $PGP_SECRET | base64 -d -i - | gpg --import + + - name: Import signing key and strip passphrase + if: env.PGP_SECRET != '' && env.PGP_PASSPHRASE != '' + env: + PGP_SECRET: ${{ secrets.PGP_SECRET }} + PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }} + run: | + echo "$PGP_SECRET" | base64 -d -i - > /tmp/signing-key.gpg + echo "$PGP_PASSPHRASE" | gpg --pinentry-mode loopback --passphrase-fd 0 --import /tmp/signing-key.gpg + (echo "$PGP_PASSPHRASE"; echo; echo) | gpg --command-fd 0 --pinentry-mode loopback --change-passphrase $(gpg --list-secret-keys --with-colons 2> /dev/null | grep '^sec:' | cut --delimiter ':' --fields 5 | tail -n 1) + + - name: Publish + env: + SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} + SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} + SONATYPE_CREDENTIAL_HOST: ${{ secrets.SONATYPE_CREDENTIAL_HOST }} + run: ./sbt tlCiRelease + + dependency-submission: + name: Submit Dependencies + if: github.event_name != 'pull_request' + strategy: + matrix: + os: [ubuntu-latest] + java: [corretto@11] + runs-on: ${{ matrix.os }} + steps: + - name: Checkout current branch (full) + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Setup Java (corretto@11) + id: setup-java-corretto-11 + if: matrix.java == 'corretto@11' + uses: actions/setup-java@v4 + with: + distribution: corretto + java-version: 11 + cache: sbt + + - name: sbt update + if: matrix.java == 'corretto@11' && steps.setup-java-corretto-11.outputs.cache-hit == 'false' + run: ./sbt +update + + - name: Submit Dependencies + uses: scalacenter/sbt-dependency-submission@v2 + with: + modules-ignore: rootjs_2.12 rootjs_2.13 rootjs_3 tests_sjs1_2.12 tests_sjs1_2.13 tests_sjs1_3 rootjvm_2.12 rootjvm_2.13 rootjvm_3 rootnative_2.12 rootnative_2.13 rootnative_3 demo_2.12 demo_2.13 demo_3 tests_2.12 tests_2.13 tests_3 demo_native0.5_2.12 demo_native0.5_2.13 demo_native0.5_3 tests_native0.5_2.12 tests_native0.5_2.13 tests_native0.5_3 demo_sjs1_2.12 demo_sjs1_2.13 demo_sjs1_3 + configs-ignore: test scala-tool scala-doc-tool test-internal diff --git a/.github/workflows/clean.yml b/.github/workflows/clean.yml index bfc865d50..547aaa43e 100644 --- a/.github/workflows/clean.yml +++ b/.github/workflows/clean.yml @@ -17,7 +17,6 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} steps: - name: Delete artifacts - shell: bash {0} run: | # Customize those three lines with your repository and credentials: REPO=${GITHUB_API_URL}/repos/${{ github.repository }} @@ -26,7 +25,7 @@ jobs: ghapi() { curl --silent --location --user _:$GITHUB_TOKEN "$@"; } # A temporary file which receives HTTP response headers. - TMPFILE=$(mktemp) + TMPFILE=/tmp/tmp.$$ # An associative array, key: artifact name, value: number of artifacts of that name. declare -A ARTCOUNT diff --git a/build.sbt b/build.sbt index 27dc2f612..499924871 100644 --- a/build.sbt +++ b/build.sbt @@ -3,22 +3,25 @@ val scala3 = "3.3.3" ThisBuild / scalaVersion := scala213 ThisBuild / crossScalaVersions := Seq("2.12.17", scala213, scala3) -ThisBuild / githubWorkflowGeneratedCI ~= { - _.map(wj => - wj.copy( - steps = WorkflowStep.Use( - ref = UseRef.Public("pierotofy", "set-swap-space", "master"), - params = Map("swap-size-gb" -> "5") - ) +: wj.steps - ) - ) -} +ThisBuild / tlBaseVersion := "2.5" val javaDistro = JavaSpec.corretto("11") ThisBuild / githubWorkflowJavaVersions := Seq(javaDistro) ThisBuild / githubWorkflowSbtCommand := "./sbt" +ThisBuild / githubWorkflowBuildMatrixExclusions ++= Seq( + MatrixExclude(Map("scala" -> "3", "project" -> "rootJVM")), // TODO + MatrixExclude( + Map("scala" -> "3", "project" -> "rootNative", "os" -> "ubuntu-latest") + ) // run on macOS instead +) + +ThisBuild / githubWorkflowBuildMatrixInclusions += + MatrixInclude(Map("scala" -> "3", "java" -> javaDistro.render, "project" -> "rootNative"), + Map("os" -> "macos-latest") + ) + val tzdbVersion = "2019c" val scalajavaLocalesVersion = "1.5.4" Global / onChangedBuildSource := ReloadOnSourceChanges @@ -29,27 +32,23 @@ lazy val downloadFromZip: TaskKey[Unit] = inThisBuild( List( - organization := "io.github.cquiroz", - licenses := Seq("BSD 3-Clause License" -> url("https://opensource.org/licenses/BSD-3-Clause")), - developers := List( + organization := "io.github.cquiroz", + licenses := Seq("BSD 3-Clause License" -> url("https://opensource.org/licenses/BSD-3-Clause")), + developers := List( Developer("cquiroz", "Carlos Quiroz", "carlos.m.quiroz@gmail.com", url("https://github.com/cquiroz") ) - ) + ), + tlSonatypeUseLegacyHost := true, + tlMimaPreviousVersions := Set(), + tlCiReleaseBranches := Seq("master"), + tlCiHeaderCheck := false ) ) -lazy val projects = List(core, tzdb, tests, demo) - -lazy val root = project - .in(file(".")) - .settings(commonSettings) - .settings( - publish / skip := true - ) - .aggregate(projects.flatMap(p => List[ProjectReference](p.jvm, p.js, p.native)): _*) +lazy val root = tlCrossRootProject.aggregate(core, tzdb, tests, demo) lazy val commonSettings = Seq( description := "java.time API implementation in Scala and Scala.js", @@ -78,7 +77,7 @@ lazy val commonSettings = Seq( } }, scalacOptions --= { - if (scalaVersion.value == scala3) + if (tlIsScala3.value) List( "-Xfatal-warnings", "-source:3.0-migration" @@ -149,7 +148,7 @@ lazy val core = crossProject(JVMPlatform, JSPlatform, NativePlatform) ) .jsSettings( scalacOptions ++= { - if (scalaVersion.value == scala3) Seq("-scalajs-genStaticForwardersForNonTopLevelObjects") + if (tlIsScala3.value) Seq("-scalajs-genStaticForwardersForNonTopLevelObjects") else Seq("-P:scalajs:genStaticForwardersForNonTopLevelObjects") }, Compile / sourceGenerators += Def.task { @@ -178,9 +177,9 @@ lazy val tzdb = crossProject(JVMPlatform, JSPlatform, NativePlatform) .in(file("tzdb")) .settings(commonSettings) .settings( - name := "scala-java-time-tzdb", - includeTTBP := true, - dbVersion := TzdbPlugin.Version(tzdbVersion) + name := "scala-java-time-tzdb", + includeTTBP := true, + dbVersion := TzdbPlugin.Version(tzdbVersion), ) .jsSettings( Compile / sourceGenerators += Def.task { @@ -206,10 +205,10 @@ lazy val tzdb = crossProject(JVMPlatform, JSPlatform, NativePlatform) lazy val tests = crossProject(JVMPlatform, JSPlatform, NativePlatform) .crossType(CrossType.Full) .in(file("tests")) + .enablePlugins(NoPublishPlugin) .settings(commonSettings) .settings( name := "tests", - publish / skip := true, Keys.`package` := file(""), libraryDependencies += "org.scalatest" %%% "scalatest" % "3.2.18" % Test, @@ -247,15 +246,14 @@ val zonesFilterFn = (x: String) => x == "Europe/Helsinki" || x == "America/Santi lazy val demo = crossProject(JSPlatform, JVMPlatform, NativePlatform) .in(file("demo")) .dependsOn(core) - .enablePlugins(TzdbPlugin) + .enablePlugins(TzdbPlugin, NoPublishPlugin) .settings( - name := "demo", - publish / skip := true, - Keys.`package` := file(""), - zonesFilter := zonesFilterFn, - dbVersion := TzdbPlugin.Version(tzdbVersion), + name := "demo", + Keys.`package` := file(""), + zonesFilter := zonesFilterFn, + dbVersion := TzdbPlugin.Version(tzdbVersion), // delegate test to run, so that it is invoked during test step in ci - Test / test := (Compile / run).toTask("").value + Test / test := (Compile / run).toTask("").value ) .jsSettings( scalaJSUseMainModuleInitializer := true diff --git a/project/plugins.sbt b/project/plugins.sbt index 0cb43037e..582cbb3d4 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -4,8 +4,7 @@ addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.16.0") addSbtPlugin("io.github.cquiroz" % "sbt-tzdb" % "4.2.0") -addSbtPlugin("com.github.sbt" % "sbt-github-actions" % "0.23.0") -addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.5.12") +addSbtPlugin("org.typelevel" % "sbt-typelevel-ci-release" % "0.7.1") addSbtPlugin("org.portable-scala" % "sbt-scala-native-crossproject" % "1.3.2") From e43957ded79f8789a597430a493e3cbdd41bed03 Mon Sep 17 00:00:00 2001 From: Ondra Pelech Date: Sat, 1 Jun 2024 01:36:35 +0200 Subject: [PATCH 13/23] -Xmx6g --- .jvmopts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.jvmopts b/.jvmopts index e24c9fe86..1fdcaa061 100644 --- a/.jvmopts +++ b/.jvmopts @@ -1,4 +1,4 @@ --Xmx4g +-Xmx6g -Xss4m -XX:MaxMetaspaceSize=1g -XX:ReservedCodeCacheSize=512m From 3cbbcc97622500a16d81960b829207df3e0fa2f5 Mon Sep 17 00:00:00 2001 From: Ondra Pelech Date: Sat, 1 Jun 2024 01:54:09 +0200 Subject: [PATCH 14/23] -Xmx3g --- .jvmopts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.jvmopts b/.jvmopts index 1fdcaa061..3b064ed1f 100644 --- a/.jvmopts +++ b/.jvmopts @@ -1,4 +1,4 @@ --Xmx6g +-Xmx3g -Xss4m -XX:MaxMetaspaceSize=1g -XX:ReservedCodeCacheSize=512m From 7aa9a4e14d99f6eb2d1d9dc2defb906e3d1dd350 Mon Sep 17 00:00:00 2001 From: Ondra Pelech Date: Sat, 1 Jun 2024 02:04:59 +0200 Subject: [PATCH 15/23] remove macos --- .github/workflows/ci.yml | 18 ++++++++++-------- build.sbt | 26 +++++++++----------------- 2 files changed, 19 insertions(+), 25 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3e668fa74..f75baf0a6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -31,17 +31,9 @@ jobs: scala: [2.12, 2.13, 3] java: [corretto@11] project: [rootJS, rootJVM, rootNative] - include: - - scala: 3 - java: corretto@11 - project: rootNative - os: macos-latest exclude: - scala: 3 project: rootJVM - - scala: 3 - project: rootNative - os: ubuntu-latest runs-on: ${{ matrix.os }} timeout-minutes: 60 steps: @@ -198,6 +190,16 @@ jobs: tar xf targets.tar rm targets.tar + - name: Download target directories (3, rootNative) + uses: actions/download-artifact@v4 + with: + name: target-${{ matrix.os }}-${{ matrix.java }}-3-rootNative + + - name: Inflate target directories (3, rootNative) + run: | + tar xf targets.tar + rm targets.tar + - name: Import signing key if: env.PGP_SECRET != '' && env.PGP_PASSPHRASE == '' env: diff --git a/build.sbt b/build.sbt index 499924871..ea711dc28 100644 --- a/build.sbt +++ b/build.sbt @@ -11,17 +11,9 @@ ThisBuild / githubWorkflowJavaVersions := Seq(javaDistro) ThisBuild / githubWorkflowSbtCommand := "./sbt" ThisBuild / githubWorkflowBuildMatrixExclusions ++= Seq( - MatrixExclude(Map("scala" -> "3", "project" -> "rootJVM")), // TODO - MatrixExclude( - Map("scala" -> "3", "project" -> "rootNative", "os" -> "ubuntu-latest") - ) // run on macOS instead + MatrixExclude(Map("scala" -> "3", "project" -> "rootJVM")) // TODO ) -ThisBuild / githubWorkflowBuildMatrixInclusions += - MatrixInclude(Map("scala" -> "3", "java" -> javaDistro.render, "project" -> "rootNative"), - Map("os" -> "macos-latest") - ) - val tzdbVersion = "2019c" val scalajavaLocalesVersion = "1.5.4" Global / onChangedBuildSource := ReloadOnSourceChanges @@ -177,9 +169,9 @@ lazy val tzdb = crossProject(JVMPlatform, JSPlatform, NativePlatform) .in(file("tzdb")) .settings(commonSettings) .settings( - name := "scala-java-time-tzdb", - includeTTBP := true, - dbVersion := TzdbPlugin.Version(tzdbVersion), + name := "scala-java-time-tzdb", + includeTTBP := true, + dbVersion := TzdbPlugin.Version(tzdbVersion) ) .jsSettings( Compile / sourceGenerators += Def.task { @@ -248,12 +240,12 @@ lazy val demo = crossProject(JSPlatform, JVMPlatform, NativePlatform) .dependsOn(core) .enablePlugins(TzdbPlugin, NoPublishPlugin) .settings( - name := "demo", - Keys.`package` := file(""), - zonesFilter := zonesFilterFn, - dbVersion := TzdbPlugin.Version(tzdbVersion), + name := "demo", + Keys.`package` := file(""), + zonesFilter := zonesFilterFn, + dbVersion := TzdbPlugin.Version(tzdbVersion), // delegate test to run, so that it is invoked during test step in ci - Test / test := (Compile / run).toTask("").value + Test / test := (Compile / run).toTask("").value ) .jsSettings( scalaJSUseMainModuleInitializer := true From 3c1a5c85f0ec0868793bc4d94dce357835062acf Mon Sep 17 00:00:00 2001 From: Ondra Pelech Date: Sat, 1 Jun 2024 02:16:49 +0200 Subject: [PATCH 16/23] UseG1GC --- .jvmopts | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.jvmopts b/.jvmopts index 3b064ed1f..51bfac925 100644 --- a/.jvmopts +++ b/.jvmopts @@ -1,6 +1,3 @@ --Xmx3g --Xss4m --XX:MaxMetaspaceSize=1g --XX:ReservedCodeCacheSize=512m --XX:+UseParallelGC +-Xmx4g +-XX:+UseG1GC -Dfile.encoding=UTF8 From 27abe9771389fad3e5c5b48d0bc493af212d55e3 Mon Sep 17 00:00:00 2001 From: Ondra Pelech Date: Sat, 1 Jun 2024 02:31:45 +0200 Subject: [PATCH 17/23] UseShenandoahGC --- .github/workflows/ci.yml | 41 ++++++++++++++++++++-------------------- .jvmopts | 2 +- build.sbt | 4 +++- 3 files changed, 25 insertions(+), 22 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f75baf0a6..602fd569e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,10 +26,11 @@ jobs: build: name: Build and Test strategy: + fail-fast: false matrix: os: [ubuntu-latest] scala: [2.12, 2.13, 3] - java: [corretto@11] + java: [temurin@11] project: [rootJS, rootJVM, rootNative] exclude: - scala: 3 @@ -42,17 +43,17 @@ jobs: with: fetch-depth: 0 - - name: Setup Java (corretto@11) - id: setup-java-corretto-11 - if: matrix.java == 'corretto@11' + - name: Setup Java (temurin@11) + id: setup-java-temurin-11 + if: matrix.java == 'temurin@11' uses: actions/setup-java@v4 with: - distribution: corretto + distribution: temurin java-version: 11 cache: sbt - name: sbt update - if: matrix.java == 'corretto@11' && steps.setup-java-corretto-11.outputs.cache-hit == 'false' + if: matrix.java == 'temurin@11' && steps.setup-java-temurin-11.outputs.cache-hit == 'false' run: ./sbt +update - name: Check that workflows are up to date @@ -70,11 +71,11 @@ jobs: run: ./sbt 'project ${{ matrix.project }}' '++ ${{ matrix.scala }}' test - name: Check binary compatibility - if: matrix.java == 'corretto@11' && matrix.os == 'ubuntu-latest' + if: matrix.java == 'temurin@11' && matrix.os == 'ubuntu-latest' run: ./sbt 'project ${{ matrix.project }}' '++ ${{ matrix.scala }}' mimaReportBinaryIssues - name: Generate API documentation - if: matrix.java == 'corretto@11' && matrix.os == 'ubuntu-latest' + if: matrix.java == 'temurin@11' && matrix.os == 'ubuntu-latest' run: ./sbt 'project ${{ matrix.project }}' '++ ${{ matrix.scala }}' doc - name: Make target directories @@ -99,7 +100,7 @@ jobs: strategy: matrix: os: [ubuntu-latest] - java: [corretto@11] + java: [temurin@11] runs-on: ${{ matrix.os }} steps: - name: Checkout current branch (full) @@ -107,17 +108,17 @@ jobs: with: fetch-depth: 0 - - name: Setup Java (corretto@11) - id: setup-java-corretto-11 - if: matrix.java == 'corretto@11' + - name: Setup Java (temurin@11) + id: setup-java-temurin-11 + if: matrix.java == 'temurin@11' uses: actions/setup-java@v4 with: - distribution: corretto + distribution: temurin java-version: 11 cache: sbt - name: sbt update - if: matrix.java == 'corretto@11' && steps.setup-java-corretto-11.outputs.cache-hit == 'false' + if: matrix.java == 'temurin@11' && steps.setup-java-temurin-11.outputs.cache-hit == 'false' run: ./sbt +update - name: Download target directories (2.12, rootJS) @@ -230,7 +231,7 @@ jobs: strategy: matrix: os: [ubuntu-latest] - java: [corretto@11] + java: [temurin@11] runs-on: ${{ matrix.os }} steps: - name: Checkout current branch (full) @@ -238,17 +239,17 @@ jobs: with: fetch-depth: 0 - - name: Setup Java (corretto@11) - id: setup-java-corretto-11 - if: matrix.java == 'corretto@11' + - name: Setup Java (temurin@11) + id: setup-java-temurin-11 + if: matrix.java == 'temurin@11' uses: actions/setup-java@v4 with: - distribution: corretto + distribution: temurin java-version: 11 cache: sbt - name: sbt update - if: matrix.java == 'corretto@11' && steps.setup-java-corretto-11.outputs.cache-hit == 'false' + if: matrix.java == 'temurin@11' && steps.setup-java-temurin-11.outputs.cache-hit == 'false' run: ./sbt +update - name: Submit Dependencies diff --git a/.jvmopts b/.jvmopts index 51bfac925..2429d30f5 100644 --- a/.jvmopts +++ b/.jvmopts @@ -1,3 +1,3 @@ -Xmx4g --XX:+UseG1GC +-XX:+UseShenandoahGC -Dfile.encoding=UTF8 diff --git a/build.sbt b/build.sbt index ea711dc28..f42328fa4 100644 --- a/build.sbt +++ b/build.sbt @@ -5,7 +5,9 @@ ThisBuild / crossScalaVersions := Seq("2.12.17", scala213, scala3) ThisBuild / tlBaseVersion := "2.5" -val javaDistro = JavaSpec.corretto("11") +ThisBuild / githubWorkflowBuildMatrixFailFast := Some(false) + +val javaDistro = JavaSpec.temurin("11") ThisBuild / githubWorkflowJavaVersions := Seq(javaDistro) ThisBuild / githubWorkflowSbtCommand := "./sbt" From 2869b13f4b0ca9c0a77090dc7a03665de54d8ce6 Mon Sep 17 00:00:00 2001 From: Ondra Pelech Date: Sat, 1 Jun 2024 02:50:23 +0200 Subject: [PATCH 18/23] -Xss4m --- .github/workflows/ci.yml | 18 ++++++++---------- .jvmopts | 2 ++ build.sbt | 10 +++++++++- 3 files changed, 19 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 602fd569e..7994dafa5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -32,9 +32,17 @@ jobs: scala: [2.12, 2.13, 3] java: [temurin@11] project: [rootJS, rootJVM, rootNative] + include: + - scala: 3 + java: temurin@11 + project: rootNative + os: macos-latest exclude: - scala: 3 project: rootJVM + - scala: 3 + project: rootNative + os: ubuntu-latest runs-on: ${{ matrix.os }} timeout-minutes: 60 steps: @@ -191,16 +199,6 @@ jobs: tar xf targets.tar rm targets.tar - - name: Download target directories (3, rootNative) - uses: actions/download-artifact@v4 - with: - name: target-${{ matrix.os }}-${{ matrix.java }}-3-rootNative - - - name: Inflate target directories (3, rootNative) - run: | - tar xf targets.tar - rm targets.tar - - name: Import signing key if: env.PGP_SECRET != '' && env.PGP_PASSPHRASE == '' env: diff --git a/.jvmopts b/.jvmopts index 2429d30f5..e55b95a22 100644 --- a/.jvmopts +++ b/.jvmopts @@ -1,3 +1,5 @@ -Xmx4g +-Xss4m -XX:+UseShenandoahGC -Dfile.encoding=UTF8 +-XX:+PrintCommandLineFlags diff --git a/build.sbt b/build.sbt index f42328fa4..a63e55a1c 100644 --- a/build.sbt +++ b/build.sbt @@ -13,9 +13,17 @@ ThisBuild / githubWorkflowJavaVersions := Seq(javaDistro) ThisBuild / githubWorkflowSbtCommand := "./sbt" ThisBuild / githubWorkflowBuildMatrixExclusions ++= Seq( - MatrixExclude(Map("scala" -> "3", "project" -> "rootJVM")) // TODO + MatrixExclude(Map("scala" -> "3", "project" -> "rootJVM")), // TODO + MatrixExclude( + Map("scala" -> "3", "project" -> "rootNative", "os" -> "ubuntu-latest") + ) // run on macOS instead ) +ThisBuild / githubWorkflowBuildMatrixInclusions += + MatrixInclude(Map("scala" -> "3", "java" -> javaDistro.render, "project" -> "rootNative"), + Map("os" -> "macos-latest") + ) + val tzdbVersion = "2019c" val scalajavaLocalesVersion = "1.5.4" Global / onChangedBuildSource := ReloadOnSourceChanges From 17991642ffea682791b3d27ec4f8bd32f963ba17 Mon Sep 17 00:00:00 2001 From: Ondra Pelech Date: Sat, 1 Jun 2024 03:02:41 +0200 Subject: [PATCH 19/23] Tags.limit(Tags.Test, 1) --- build.sbt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/build.sbt b/build.sbt index a63e55a1c..d110c2e53 100644 --- a/build.sbt +++ b/build.sbt @@ -27,7 +27,10 @@ ThisBuild / githubWorkflowBuildMatrixInclusions += val tzdbVersion = "2019c" val scalajavaLocalesVersion = "1.5.4" Global / onChangedBuildSource := ReloadOnSourceChanges -Global / concurrentRestrictions += Tags.limit(NativeTags.Link, 1) +Global / concurrentRestrictions ++= List( + Tags.limit(NativeTags.Link, 1), + Tags.limit(Tags.Test, 1) +) lazy val downloadFromZip: TaskKey[Unit] = taskKey[Unit]("Download the tzdb tarball and extract it") From 2f9192f57d0a51b1ce0ab43195f8ed9ffb252a1d Mon Sep 17 00:00:00 2001 From: Ondra Pelech Date: Sat, 1 Jun 2024 03:03:40 +0200 Subject: [PATCH 20/23] -Xmx5g --- .jvmopts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.jvmopts b/.jvmopts index e55b95a22..f18d2b056 100644 --- a/.jvmopts +++ b/.jvmopts @@ -1,4 +1,4 @@ --Xmx4g +-Xmx5g -Xss4m -XX:+UseShenandoahGC -Dfile.encoding=UTF8 From 7d2291c42a62abd5957d2dacacdaf490bed0ff54 Mon Sep 17 00:00:00 2001 From: Ondra Pelech Date: Wed, 5 Jun 2024 11:42:10 +0200 Subject: [PATCH 21/23] Scala Native 0.5.3 --- .github/workflows/ci.yml | 42 ++++++++++++++++++++-------------------- .jvmopts | 3 +-- build.sbt | 6 +----- project/plugins.sbt | 2 +- 4 files changed, 24 insertions(+), 29 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7994dafa5..9c70f21ca 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -30,11 +30,11 @@ jobs: matrix: os: [ubuntu-latest] scala: [2.12, 2.13, 3] - java: [temurin@11] + java: [corretto@11] project: [rootJS, rootJVM, rootNative] include: - scala: 3 - java: temurin@11 + java: corretto@11 project: rootNative os: macos-latest exclude: @@ -51,17 +51,17 @@ jobs: with: fetch-depth: 0 - - name: Setup Java (temurin@11) - id: setup-java-temurin-11 - if: matrix.java == 'temurin@11' + - name: Setup Java (corretto@11) + id: setup-java-corretto-11 + if: matrix.java == 'corretto@11' uses: actions/setup-java@v4 with: - distribution: temurin + distribution: corretto java-version: 11 cache: sbt - name: sbt update - if: matrix.java == 'temurin@11' && steps.setup-java-temurin-11.outputs.cache-hit == 'false' + if: matrix.java == 'corretto@11' && steps.setup-java-corretto-11.outputs.cache-hit == 'false' run: ./sbt +update - name: Check that workflows are up to date @@ -79,11 +79,11 @@ jobs: run: ./sbt 'project ${{ matrix.project }}' '++ ${{ matrix.scala }}' test - name: Check binary compatibility - if: matrix.java == 'temurin@11' && matrix.os == 'ubuntu-latest' + if: matrix.java == 'corretto@11' && matrix.os == 'ubuntu-latest' run: ./sbt 'project ${{ matrix.project }}' '++ ${{ matrix.scala }}' mimaReportBinaryIssues - name: Generate API documentation - if: matrix.java == 'temurin@11' && matrix.os == 'ubuntu-latest' + if: matrix.java == 'corretto@11' && matrix.os == 'ubuntu-latest' run: ./sbt 'project ${{ matrix.project }}' '++ ${{ matrix.scala }}' doc - name: Make target directories @@ -108,7 +108,7 @@ jobs: strategy: matrix: os: [ubuntu-latest] - java: [temurin@11] + java: [corretto@11] runs-on: ${{ matrix.os }} steps: - name: Checkout current branch (full) @@ -116,17 +116,17 @@ jobs: with: fetch-depth: 0 - - name: Setup Java (temurin@11) - id: setup-java-temurin-11 - if: matrix.java == 'temurin@11' + - name: Setup Java (corretto@11) + id: setup-java-corretto-11 + if: matrix.java == 'corretto@11' uses: actions/setup-java@v4 with: - distribution: temurin + distribution: corretto java-version: 11 cache: sbt - name: sbt update - if: matrix.java == 'temurin@11' && steps.setup-java-temurin-11.outputs.cache-hit == 'false' + if: matrix.java == 'corretto@11' && steps.setup-java-corretto-11.outputs.cache-hit == 'false' run: ./sbt +update - name: Download target directories (2.12, rootJS) @@ -229,7 +229,7 @@ jobs: strategy: matrix: os: [ubuntu-latest] - java: [temurin@11] + java: [corretto@11] runs-on: ${{ matrix.os }} steps: - name: Checkout current branch (full) @@ -237,17 +237,17 @@ jobs: with: fetch-depth: 0 - - name: Setup Java (temurin@11) - id: setup-java-temurin-11 - if: matrix.java == 'temurin@11' + - name: Setup Java (corretto@11) + id: setup-java-corretto-11 + if: matrix.java == 'corretto@11' uses: actions/setup-java@v4 with: - distribution: temurin + distribution: corretto java-version: 11 cache: sbt - name: sbt update - if: matrix.java == 'temurin@11' && steps.setup-java-temurin-11.outputs.cache-hit == 'false' + if: matrix.java == 'corretto@11' && steps.setup-java-corretto-11.outputs.cache-hit == 'false' run: ./sbt +update - name: Submit Dependencies diff --git a/.jvmopts b/.jvmopts index f18d2b056..821e5d8a6 100644 --- a/.jvmopts +++ b/.jvmopts @@ -1,5 +1,4 @@ --Xmx5g +-Xmx4g -Xss4m --XX:+UseShenandoahGC -Dfile.encoding=UTF8 -XX:+PrintCommandLineFlags diff --git a/build.sbt b/build.sbt index d110c2e53..882f37b56 100644 --- a/build.sbt +++ b/build.sbt @@ -7,7 +7,7 @@ ThisBuild / tlBaseVersion := "2.5" ThisBuild / githubWorkflowBuildMatrixFailFast := Some(false) -val javaDistro = JavaSpec.temurin("11") +val javaDistro = JavaSpec.corretto("11") ThisBuild / githubWorkflowJavaVersions := Seq(javaDistro) ThisBuild / githubWorkflowSbtCommand := "./sbt" @@ -27,10 +27,6 @@ ThisBuild / githubWorkflowBuildMatrixInclusions += val tzdbVersion = "2019c" val scalajavaLocalesVersion = "1.5.4" Global / onChangedBuildSource := ReloadOnSourceChanges -Global / concurrentRestrictions ++= List( - Tags.limit(NativeTags.Link, 1), - Tags.limit(Tags.Test, 1) -) lazy val downloadFromZip: TaskKey[Unit] = taskKey[Unit]("Download the tzdb tarball and extract it") diff --git a/project/plugins.sbt b/project/plugins.sbt index 582cbb3d4..067852e0b 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -8,4 +8,4 @@ addSbtPlugin("org.typelevel" % "sbt-typelevel-ci-release" % "0.7.1") addSbtPlugin("org.portable-scala" % "sbt-scala-native-crossproject" % "1.3.2") -addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.5.1") +addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.5.3") From 6b6d2dc088334f1f664867f50b342d8c8710eb17 Mon Sep 17 00:00:00 2001 From: Ondra Pelech Date: Wed, 5 Jun 2024 11:59:56 +0200 Subject: [PATCH 22/23] Drop direct dependency on portable-scala-reflect --- build.sbt | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/build.sbt b/build.sbt index 882f37b56..11a9e9ec9 100644 --- a/build.sbt +++ b/build.sbt @@ -143,9 +143,7 @@ lazy val core = crossProject(JVMPlatform, JSPlatform, NativePlatform) .in(file("core")) .settings(commonSettings) .settings( - name := "scala-java-time", - libraryDependencies += ("org.portable-scala" %%% "portable-scala-reflect" % "1.1.3") - .cross(CrossVersion.for3Use2_13) + name := "scala-java-time" ) .jsSettings( scalacOptions ++= { From 5a5adf3ada08fdfc0662f60925e22eb14d46c541 Mon Sep 17 00:00:00 2001 From: Ondra Pelech Date: Wed, 5 Jun 2024 12:04:08 +0200 Subject: [PATCH 23/23] Revert "Drop direct dependency on portable-scala-reflect" This reverts commit 6b6d2dc088334f1f664867f50b342d8c8710eb17. --- build.sbt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/build.sbt b/build.sbt index 11a9e9ec9..882f37b56 100644 --- a/build.sbt +++ b/build.sbt @@ -143,7 +143,9 @@ lazy val core = crossProject(JVMPlatform, JSPlatform, NativePlatform) .in(file("core")) .settings(commonSettings) .settings( - name := "scala-java-time" + name := "scala-java-time", + libraryDependencies += ("org.portable-scala" %%% "portable-scala-reflect" % "1.1.3") + .cross(CrossVersion.for3Use2_13) ) .jsSettings( scalacOptions ++= {