From 043cc21c8f536c0ad0566491eabc86ae764285c8 Mon Sep 17 00:00:00 2001 From: Colin Dean Date: Mon, 3 Apr 2023 13:28:10 -0400 Subject: [PATCH] Use coursier/setup-action instead of deprecated olafurpg/setup-scala There were many options suggested in text and in other PRs linked from https://github.com/olafurpg/setup-scala/issues/49 but this seems to make the most sense for DV and also _really_ reduces the workflow code. Fixes #142 --- .github/workflows/ci.yaml | 20 ++++---------------- .github/workflows/release.yaml | 20 ++++---------------- 2 files changed, 8 insertions(+), 32 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index ac648cf..638c75f 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -17,23 +17,11 @@ jobs: steps: - name: Checkout current branch (full) uses: actions/checkout@v3 - - - name: Setup Java and Scala - uses: olafurpg/setup-scala@v14 + - uses: coursier/cache-action@v6 with: - java-version: adopt@1.8 - - - name: Cache sbt - uses: actions/cache@v3 + extraKey: ${{ runner.os }} + - uses: coursier/setup-action@v1 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') }} - + jvm: adopt:1.8 - name: Build, test, and package project run: bin/sbt clean compile test package makePom diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 5363501..18dbf7a 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -16,24 +16,12 @@ jobs: steps: - name: Checkout current branch (full) uses: actions/checkout@v3 - - - name: Setup Java and Scala - uses: olafurpg/setup-scala@v14 + - uses: coursier/cache-action@v6 with: - java-version: adopt@1.8 - - - name: Cache sbt - uses: actions/cache@v3 + extraKey: ${{ runner.os }} + - uses: coursier/setup-action@v1 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') }} - + jvm: adopt:1.8 # uses sbt-github-packages, see build.sbt - name: Publish with SBT run: bin/sbt publish