From 4300349cf9e5a8b177c7209cf18c08ac8de8a390 Mon Sep 17 00:00:00 2001 From: Matthew de Detrich Date: Mon, 4 Apr 2022 11:55:38 +0200 Subject: [PATCH 1/7] Make documentation consistent (#37) --- README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 69a20ba..762c59c 100644 --- a/README.md +++ b/README.md @@ -316,7 +316,7 @@ val result: Future[Int] = retryWithBackOff(5, 5.seconds) { } ``` -### CancelableFuture +### Cancelling Future's - [markatta.futiles.CancellableFuture](src/main/scala/markatta/futiles/CancellableFuture.scala) If you need to create a ```Future``` that you want to cancel at a later point in time then you can use a `CancelableFuture`. @@ -337,3 +337,6 @@ it also does not handle cleaning up of resources (such as file handles) since fu computations deriving from `.map`/`.flatMap`/`onComplete` may not execute. If a `CancelableFuture` was cancelled this way it will fail with a `CancellationException` exception. + +Note that `CancellableFuture` implements the `scala.concurrent.Future` interface which +means you can also use it as a standard `Future`. From 18868f252bbf5dd71d2cd0fc67e7eb39863b686a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johan=20Andr=C3=A9n?= Date: Mon, 4 Apr 2022 12:04:28 +0200 Subject: [PATCH 2/7] Bump latest released 2.0.2 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 762c59c..fdfd7ae 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ License: [Apache Licence v2](https://www.apache.org/licenses/LICENSE-2.0.txt). The artifact is on maven central and can be used by adding it to your project dependencies in sbt: ```scala -libraryDependencies += "com.markatta" %% "futiles" % "2.0.1" +libraryDependencies += "com.markatta" %% "futiles" % "2.0.2" ``` Latest stable version: From 8259de0b164c0e154b6b0e40a7a4673d56591c2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johan=20Andr=C3=A9n?= Date: Thu, 1 Feb 2024 09:39:39 +0100 Subject: [PATCH 3/7] Move away from plugins published only to repo.scala-sbt.org --- build.sbt | 2 +- project/build.properties | 2 +- project/plugins.sbt | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/build.sbt b/build.sbt index 345a3f8..538d02c 100644 --- a/build.sbt +++ b/build.sbt @@ -1,7 +1,7 @@ ThisBuild / name := "futiles" ThisBuild / organization := "com.markatta" -ThisBuild / crossScalaVersions := Seq("2.12.15", "2.11.12", "2.13.8") +ThisBuild / crossScalaVersions := Seq("2.12.18", "2.13.12") ThisBuild / scalaVersion := crossScalaVersions.value.last val flagsFor11 = Seq( diff --git a/project/build.properties b/project/build.properties index c8fcab5..abbbce5 100644 --- a/project/build.properties +++ b/project/build.properties @@ -1 +1 @@ -sbt.version=1.6.2 +sbt.version=1.9.8 diff --git a/project/plugins.sbt b/project/plugins.sbt index 971d12b..aa0790f 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -1,6 +1,6 @@ -addSbtPlugin("de.heikoseeberger" % "sbt-header" % "5.6.0") +addSbtPlugin("de.heikoseeberger" % "sbt-header" % "5.10.0") addSbtPlugin("com.codecommit" % "sbt-github-actions" % "0.14.2") addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.6") addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.9.3") addSbtPlugin("org.scoverage" % "sbt-coveralls" % "1.3.1") -addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.5.10") +addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.5.12") From 37abc7da374c005f10c6a6a5c76c95880bb68327 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johan=20Andr=C3=A9n?= Date: Thu, 1 Feb 2024 09:44:14 +0100 Subject: [PATCH 4/7] Only build 2.12 and 2.13, but include JDK 21 --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index da3abfb..71e49d9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,8 +23,8 @@ jobs: strategy: matrix: os: [ubuntu-latest] - scala: [2.12.15, 2.11.12, 2.13.8] - java: [temurin@11, temurin@17] + scala: [2.12.18, 2.13.12] + java: [temurin@11, temurin@17, temurin@21] runs-on: ${{ matrix.os }} steps: - name: Checkout current branch (full) From 35235cef6a60bd4b802c8658d5164af9e22174f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johan=20Andr=C3=A9n?= Date: Thu, 1 Feb 2024 09:46:47 +0100 Subject: [PATCH 5/7] Let githubWorkflowGenerate generate it --- .github/workflows/ci.yml | 26 ++++++++------------------ 1 file changed, 8 insertions(+), 18 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 71e49d9..adc8df4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,7 +24,7 @@ jobs: matrix: os: [ubuntu-latest] scala: [2.12.18, 2.13.12] - java: [temurin@11, temurin@17, temurin@21] + java: [temurin@11, temurin@17] runs-on: ${{ matrix.os }} steps: - name: Checkout current branch (full) @@ -86,7 +86,7 @@ jobs: strategy: matrix: os: [ubuntu-latest] - scala: [2.13.8] + scala: [2.13.12] java: [temurin@11] runs-on: ${{ matrix.os }} steps: @@ -121,32 +121,22 @@ jobs: ~/Library/Caches/Coursier/v1 key: ${{ runner.os }}-sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }} - - name: Download target directories (2.12.15) + - name: Download target directories (2.12.18) uses: actions/download-artifact@v2 with: - name: target-${{ matrix.os }}-2.12.15-${{ matrix.java }} + name: target-${{ matrix.os }}-2.12.18-${{ matrix.java }} - - name: Inflate target directories (2.12.15) + - name: Inflate target directories (2.12.18) run: | tar xf targets.tar rm targets.tar - - name: Download target directories (2.11.12) + - name: Download target directories (2.13.12) uses: actions/download-artifact@v2 with: - name: target-${{ matrix.os }}-2.11.12-${{ matrix.java }} + name: target-${{ matrix.os }}-2.13.12-${{ matrix.java }} - - name: Inflate target directories (2.11.12) - run: | - tar xf targets.tar - rm targets.tar - - - name: Download target directories (2.13.8) - uses: actions/download-artifact@v2 - with: - name: target-${{ matrix.os }}-2.13.8-${{ matrix.java }} - - - name: Inflate target directories (2.13.8) + - name: Inflate target directories (2.13.12) run: | tar xf targets.tar rm targets.tar From cd2c17d94fbb531f565b9b906628930b67c45e4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johan=20Andr=C3=A9n?= Date: Thu, 1 Feb 2024 10:55:54 +0100 Subject: [PATCH 6/7] Two more plugin bumps --- project/plugins.sbt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/project/plugins.sbt b/project/plugins.sbt index aa0790f..f8f8682 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -1,6 +1,6 @@ addSbtPlugin("de.heikoseeberger" % "sbt-header" % "5.10.0") addSbtPlugin("com.codecommit" % "sbt-github-actions" % "0.14.2") addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.6") -addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.9.3") -addSbtPlugin("org.scoverage" % "sbt-coveralls" % "1.3.1") +addSbtPlugin("org.scoverage" % "sbt-scoverage" % "2.0.9") +addSbtPlugin("org.scoverage" % "sbt-coveralls" % "1.3.11") addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.5.12") From 06c82ef07225bfe6c5c22d2a7c98516e0b7c6c2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johan=20Andr=C3=A9n?= Date: Wed, 14 May 2025 18:08:46 +0200 Subject: [PATCH 7/7] build: New sonatype auth stuff (#38) Also: updated github actions workflows --- .github/workflows/ci.yml | 56 ++++++++++++++----------------------- .github/workflows/clean.yml | 3 +- build.sbt | 2 ++ project/plugins.sbt | 4 +-- 4 files changed, 27 insertions(+), 38 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index adc8df4..bd3b4d6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -28,53 +28,46 @@ jobs: runs-on: ${{ matrix.os }} steps: - name: Checkout current branch (full) - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: fetch-depth: 0 - name: Setup Java (temurin@11) if: matrix.java == 'temurin@11' - uses: actions/setup-java@v2 + uses: actions/setup-java@v4 with: distribution: temurin java-version: 11 + cache: sbt - name: Setup Java (temurin@17) if: matrix.java == 'temurin@17' - uses: actions/setup-java@v2 + uses: actions/setup-java@v4 with: distribution: temurin java-version: 17 + cache: sbt - - 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: Setup sbt + uses: sbt/setup-sbt@v1 - name: Check that workflows are up to date - run: sbt ++${{ matrix.scala }} githubWorkflowCheck + run: sbt '++ ${{ matrix.scala }}' githubWorkflowCheck - name: Build project - run: sbt ++${{ matrix.scala }} clean coverage test + run: sbt '++ ${{ matrix.scala }}' clean coverage test - name: Upload coverage data to Coveralls env: COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} COVERALLS_FLAG_NAME: Scala ${{ matrix.scala }} - run: sbt ++${{ matrix.scala }} coverageReport coverageAggregate coveralls + run: sbt '++ ${{ matrix.scala }}' coverageReport coverageAggregate coveralls - name: Compress target directories run: tar cf targets.tar target project/target - name: Upload target directories - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: target-${{ matrix.os }}-${{ matrix.scala }}-${{ matrix.java }} path: targets.tar @@ -91,38 +84,31 @@ jobs: runs-on: ${{ matrix.os }} steps: - name: Checkout current branch (full) - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: fetch-depth: 0 - name: Setup Java (temurin@11) if: matrix.java == 'temurin@11' - uses: actions/setup-java@v2 + uses: actions/setup-java@v4 with: distribution: temurin java-version: 11 + cache: sbt - name: Setup Java (temurin@17) if: matrix.java == 'temurin@17' - uses: actions/setup-java@v2 + uses: actions/setup-java@v4 with: distribution: temurin java-version: 17 + cache: sbt - - 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: Setup sbt + uses: sbt/setup-sbt@v1 - name: Download target directories (2.12.18) - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v4 with: name: target-${{ matrix.os }}-2.12.18-${{ matrix.java }} @@ -132,7 +118,7 @@ jobs: rm targets.tar - name: Download target directories (2.13.12) - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v4 with: name: target-${{ matrix.os }}-2.13.12-${{ matrix.java }} @@ -146,4 +132,4 @@ jobs: PGP_SECRET: ${{ secrets.PGP_SECRET }} SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} - run: sbt ++${{ matrix.scala }} ci-release + run: sbt ci-release diff --git a/.github/workflows/clean.yml b/.github/workflows/clean.yml index 547aaa4..bfc865d 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 538d02c..4b80412 100644 --- a/build.sbt +++ b/build.sbt @@ -66,6 +66,8 @@ developers := List( Developer("johanandren", "Johan Andrén", "johan@markatta.com", url("https://markatta.com/johan/codemonkey")) ) +ThisBuild / sonatypeCredentialHost := xerial.sbt.Sonatype.sonatypeCentralHost + ThisBuild / githubWorkflowJavaVersions := List( JavaSpec.temurin("11"), JavaSpec.temurin("17") diff --git a/project/plugins.sbt b/project/plugins.sbt index f8f8682..40054a1 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -1,6 +1,6 @@ addSbtPlugin("de.heikoseeberger" % "sbt-header" % "5.10.0") -addSbtPlugin("com.codecommit" % "sbt-github-actions" % "0.14.2") +addSbtPlugin("com.github.sbt" % "sbt-github-actions" % "0.25.0") addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.6") addSbtPlugin("org.scoverage" % "sbt-scoverage" % "2.0.9") addSbtPlugin("org.scoverage" % "sbt-coveralls" % "1.3.11") -addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.5.12") +addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.9.3")