diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0644a9c..1a16d69 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,13 +27,13 @@ jobs: runs-on: ${{ matrix.os }} steps: - name: Checkout current branch (full) - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: fetch-depth: 0 - name: Setup Java (temurin@11) if: matrix.java == 'temurin@11' - uses: actions/setup-java@v2 + uses: actions/setup-java@v3 with: distribution: temurin java-version: 11 @@ -46,7 +46,7 @@ jobs: java: java11 - name: Cache sbt - uses: actions/cache@v2 + uses: actions/cache@v3 with: path: | ~/.sbt @@ -55,7 +55,7 @@ jobs: ~/.cache/coursier/v1 ~/AppData/Local/Coursier/Cache/v1 ~/Library/Caches/Coursier/v1 - key: ${{ runner.os }}-sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }} + key: ${{ runner.os }}-sbt-cache-v3-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }} - name: Check that workflows are up to date run: sbt ++${{ matrix.scala }} githubWorkflowCheck @@ -66,7 +66,7 @@ jobs: run: tar cf targets.tar target project/target - name: Upload target directories - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: target-${{ matrix.os }}-${{ matrix.scala }}-${{ matrix.java }} path: targets.tar @@ -83,13 +83,13 @@ jobs: runs-on: ${{ matrix.os }} steps: - name: Checkout current branch (full) - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: fetch-depth: 0 - name: Setup Java (temurin@11) if: matrix.java == 'temurin@11' - uses: actions/setup-java@v2 + uses: actions/setup-java@v3 with: distribution: temurin java-version: 11 @@ -102,7 +102,7 @@ jobs: java: java11 - name: Cache sbt - uses: actions/cache@v2 + uses: actions/cache@v3 with: path: | ~/.sbt @@ -111,10 +111,10 @@ jobs: ~/.cache/coursier/v1 ~/AppData/Local/Coursier/Cache/v1 ~/Library/Caches/Coursier/v1 - key: ${{ runner.os }}-sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }} + key: ${{ runner.os }}-sbt-cache-v3-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }} - name: Download target directories (2.12.15) - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v3 with: name: target-${{ matrix.os }}-2.12.15-${{ matrix.java }} diff --git a/src/main/scala/sbtghactions/GenerativePlugin.scala b/src/main/scala/sbtghactions/GenerativePlugin.scala index c0f4edb..bbe94c1 100644 --- a/src/main/scala/sbtghactions/GenerativePlugin.scala +++ b/src/main/scala/sbtghactions/GenerativePlugin.scala @@ -607,7 +607,7 @@ ${indent(jobs.map(compileJob(_, sbt)).mkString("\n\n"), 1)} UseRef.Public( "actions", "upload-artifact", - "v2"), + "v3"), name = Some(s"Upload target directories"), params = Map( "name" -> s"target-$${{ matrix.os }}-$${{ matrix.scala }}-$${{ matrix.java }}", @@ -628,7 +628,7 @@ ${indent(jobs.map(compileJob(_, sbt)).mkString("\n\n"), 1)} UseRef.Public( "actions", "download-artifact", - "v2"), + "v3"), name = Some(s"Download target directories ($v)"), params = Map( "name" -> s"target-$${{ matrix.os }}-$v-$${{ matrix.java }}")) @@ -656,7 +656,7 @@ ${indent(jobs.map(compileJob(_, sbt)).mkString("\n\n"), 1)} UseRef.Public( "actions", "cache", - "v2"), + "v3"), name = Some("Cache sbt"), params = Map( "path" -> Seq( @@ -667,7 +667,7 @@ ${indent(jobs.map(compileJob(_, sbt)).mkString("\n\n"), 1)} "~/AppData/Local/Coursier/Cache/v1", "~/Library/Caches/Coursier/v1" ).mkString("\n"), - "key" -> s"$${{ runner.os }}-sbt-cache-v2-${hashes.mkString("-")}" + "key" -> s"$${{ runner.os }}-sbt-cache-v3-${hashes.mkString("-")}" ) ) ) diff --git a/src/main/scala/sbtghactions/WorkflowStep.scala b/src/main/scala/sbtghactions/WorkflowStep.scala index 8dff410..420e142 100644 --- a/src/main/scala/sbtghactions/WorkflowStep.scala +++ b/src/main/scala/sbtghactions/WorkflowStep.scala @@ -26,11 +26,11 @@ sealed trait WorkflowStep extends Product with Serializable { object WorkflowStep { val CheckoutFull: WorkflowStep = Use( - UseRef.Public("actions", "checkout", "v2"), + UseRef.Public("actions", "checkout", "v3"), name = Some("Checkout current branch (full)"), params = Map("fetch-depth" -> "0")) - val Checkout: WorkflowStep = Use(UseRef.Public("actions", "checkout", "v2"), name = Some("Checkout current branch (fast)")) + val Checkout: WorkflowStep = Use(UseRef.Public("actions", "checkout", "v3"), name = Some("Checkout current branch (fast)")) def SetupJava(versions: List[JavaSpec]): List[WorkflowStep] = versions map { @@ -45,7 +45,7 @@ object WorkflowStep { case jv @ JavaSpec(dist, version) => WorkflowStep.Use( - UseRef.Public("actions", "setup-java", "v2"), + UseRef.Public("actions", "setup-java", "v3"), name = Some(s"Setup Java (${jv.render})"), cond = Some(s"matrix.java == '${jv.render}'"), params = Map( diff --git a/src/sbt-test/sbtghactions/check-and-regenerate/expected-ci.yml b/src/sbt-test/sbtghactions/check-and-regenerate/expected-ci.yml index ee1ed2d..0bffc3d 100644 --- a/src/sbt-test/sbtghactions/check-and-regenerate/expected-ci.yml +++ b/src/sbt-test/sbtghactions/check-and-regenerate/expected-ci.yml @@ -35,13 +35,13 @@ jobs: runs-on: ${{ matrix.os }} steps: - name: Checkout current branch (full) - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: fetch-depth: 0 - name: Setup Java (temurin@11) if: matrix.java == 'temurin@11' - uses: actions/setup-java@v2 + uses: actions/setup-java@v3 with: distribution: temurin java-version: 11 @@ -54,7 +54,7 @@ jobs: java: java8 - name: Cache sbt - uses: actions/cache@v2 + uses: actions/cache@v3 with: path: | ~/.sbt @@ -63,7 +63,7 @@ jobs: ~/.cache/coursier/v1 ~/AppData/Local/Coursier/Cache/v1 ~/Library/Caches/Coursier/v1 - key: ${{ runner.os }}-sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }} + key: ${{ runner.os }}-sbt-cache-v3-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }} - name: Check that workflows are up to date run: sbt ++${{ matrix.scala }} githubWorkflowCheck @@ -77,7 +77,7 @@ jobs: run: tar cf targets.tar target project/target - name: Upload target directories - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: target-${{ matrix.os }}-${{ matrix.scala }}-${{ matrix.java }} path: targets.tar @@ -94,13 +94,13 @@ jobs: runs-on: ${{ matrix.os }} steps: - name: Checkout current branch (full) - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: fetch-depth: 0 - name: Setup Java (temurin@11) if: matrix.java == 'temurin@11' - uses: actions/setup-java@v2 + uses: actions/setup-java@v3 with: distribution: temurin java-version: 11 @@ -113,7 +113,7 @@ jobs: java: java8 - name: Cache sbt - uses: actions/cache@v2 + uses: actions/cache@v3 with: path: | ~/.sbt @@ -122,10 +122,10 @@ jobs: ~/.cache/coursier/v1 ~/AppData/Local/Coursier/Cache/v1 ~/Library/Caches/Coursier/v1 - key: ${{ runner.os }}-sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }} + key: ${{ runner.os }}-sbt-cache-v3-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }} - name: Download target directories (2.13.6) - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v3 with: name: target-${{ matrix.os }}-2.13.6-${{ matrix.java }} @@ -135,7 +135,7 @@ jobs: rm targets.tar - name: Download target directories (2.12.15) - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v3 with: name: target-${{ matrix.os }}-2.12.15-${{ matrix.java }} diff --git a/src/sbt-test/sbtghactions/no-clean/.github/workflows/ci.yml b/src/sbt-test/sbtghactions/no-clean/.github/workflows/ci.yml index 3917583..8f583fb 100644 --- a/src/sbt-test/sbtghactions/no-clean/.github/workflows/ci.yml +++ b/src/sbt-test/sbtghactions/no-clean/.github/workflows/ci.yml @@ -27,19 +27,19 @@ jobs: runs-on: ${{ matrix.os }} steps: - name: Checkout current branch (full) - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: fetch-depth: 0 - name: Setup Java (temurin@11) if: matrix.java == 'temurin@11' - uses: actions/setup-java@v2 + uses: actions/setup-java@v3 with: distribution: temurin java-version: 11 - name: Cache sbt - uses: actions/cache@v2 + uses: actions/cache@v3 with: path: | ~/.sbt @@ -48,7 +48,7 @@ jobs: ~/.cache/coursier/v1 ~/AppData/Local/Coursier/Cache/v1 ~/Library/Caches/Coursier/v1 - key: ${{ runner.os }}-sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }} + key: ${{ runner.os }}-sbt-cache-v3-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }} - name: Check that workflows are up to date run: sbt ++${{ matrix.scala }} githubWorkflowCheck @@ -60,7 +60,7 @@ jobs: run: tar cf targets.tar target project/target - name: Upload target directories - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: target-${{ matrix.os }}-${{ matrix.scala }}-${{ matrix.java }} path: targets.tar @@ -77,19 +77,19 @@ jobs: runs-on: ${{ matrix.os }} steps: - name: Checkout current branch (full) - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: fetch-depth: 0 - name: Setup Java (temurin@11) if: matrix.java == 'temurin@11' - uses: actions/setup-java@v2 + uses: actions/setup-java@v3 with: distribution: temurin java-version: 11 - name: Cache sbt - uses: actions/cache@v2 + uses: actions/cache@v3 with: path: | ~/.sbt @@ -98,10 +98,10 @@ jobs: ~/.cache/coursier/v1 ~/AppData/Local/Coursier/Cache/v1 ~/Library/Caches/Coursier/v1 - key: ${{ runner.os }}-sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }} + key: ${{ runner.os }}-sbt-cache-v3-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }} - name: Download target directories (2.13.6) - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v3 with: name: target-${{ matrix.os }}-2.13.6-${{ matrix.java }} @@ -111,7 +111,7 @@ jobs: rm targets.tar - name: Download target directories (2.12.15) - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v3 with: name: target-${{ matrix.os }}-2.12.15-${{ matrix.java }} diff --git a/src/sbt-test/sbtghactions/non-existent-target/.github/workflows/ci.yml b/src/sbt-test/sbtghactions/non-existent-target/.github/workflows/ci.yml index f3ebe4b..22ba52d 100644 --- a/src/sbt-test/sbtghactions/non-existent-target/.github/workflows/ci.yml +++ b/src/sbt-test/sbtghactions/non-existent-target/.github/workflows/ci.yml @@ -27,19 +27,19 @@ jobs: runs-on: ${{ matrix.os }} steps: - name: Checkout current branch (full) - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: fetch-depth: 0 - name: Setup Java (temurin@11) if: matrix.java == 'temurin@11' - uses: actions/setup-java@v2 + uses: actions/setup-java@v3 with: distribution: temurin java-version: 11 - name: Cache sbt - uses: actions/cache@v2 + uses: actions/cache@v3 with: path: | ~/.sbt @@ -48,7 +48,7 @@ jobs: ~/.cache/coursier/v1 ~/AppData/Local/Coursier/Cache/v1 ~/Library/Caches/Coursier/v1 - key: ${{ runner.os }}-sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }} + key: ${{ runner.os }}-sbt-cache-v3-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }} - name: Check that workflows are up to date run: sbt ++${{ matrix.scala }} githubWorkflowCheck @@ -59,7 +59,7 @@ jobs: run: tar cf targets.tar target withTarget/target project/target - name: Upload target directories - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: target-${{ matrix.os }}-${{ matrix.scala }}-${{ matrix.java }} path: targets.tar @@ -76,19 +76,19 @@ jobs: runs-on: ${{ matrix.os }} steps: - name: Checkout current branch (full) - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: fetch-depth: 0 - name: Setup Java (temurin@11) if: matrix.java == 'temurin@11' - uses: actions/setup-java@v2 + uses: actions/setup-java@v3 with: distribution: temurin java-version: 11 - name: Cache sbt - uses: actions/cache@v2 + uses: actions/cache@v3 with: path: | ~/.sbt @@ -97,10 +97,10 @@ jobs: ~/.cache/coursier/v1 ~/AppData/Local/Coursier/Cache/v1 ~/Library/Caches/Coursier/v1 - key: ${{ runner.os }}-sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }} + key: ${{ runner.os }}-sbt-cache-v3-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }} - name: Download target directories (2.13.6) - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v3 with: name: target-${{ matrix.os }}-2.13.6-${{ matrix.java }} diff --git a/src/sbt-test/sbtghactions/sbt-native-thin-client/.github/workflows/ci.yml b/src/sbt-test/sbtghactions/sbt-native-thin-client/.github/workflows/ci.yml index fde4de8..5a062ed 100644 --- a/src/sbt-test/sbtghactions/sbt-native-thin-client/.github/workflows/ci.yml +++ b/src/sbt-test/sbtghactions/sbt-native-thin-client/.github/workflows/ci.yml @@ -27,19 +27,19 @@ jobs: runs-on: ${{ matrix.os }} steps: - name: Checkout current branch (full) - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: fetch-depth: 0 - name: Setup Java (temurin@11) if: matrix.java == 'temurin@11' - uses: actions/setup-java@v2 + uses: actions/setup-java@v3 with: distribution: temurin java-version: 11 - name: Cache sbt - uses: actions/cache@v2 + uses: actions/cache@v3 with: path: | ~/.sbt @@ -48,7 +48,7 @@ jobs: ~/.cache/coursier/v1 ~/AppData/Local/Coursier/Cache/v1 ~/Library/Caches/Coursier/v1 - key: ${{ runner.os }}-sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }} + key: ${{ runner.os }}-sbt-cache-v3-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }} - name: Check that workflows are up to date run: sbt --client '++${{ matrix.scala }}; githubWorkflowCheck' @@ -76,7 +76,7 @@ jobs: run: tar cf targets.tar target project/target - name: Upload target directories - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: target-${{ matrix.os }}-${{ matrix.scala }}-${{ matrix.java }} path: targets.tar @@ -93,19 +93,19 @@ jobs: runs-on: ${{ matrix.os }} steps: - name: Checkout current branch (full) - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: fetch-depth: 0 - name: Setup Java (temurin@11) if: matrix.java == 'temurin@11' - uses: actions/setup-java@v2 + uses: actions/setup-java@v3 with: distribution: temurin java-version: 11 - name: Cache sbt - uses: actions/cache@v2 + uses: actions/cache@v3 with: path: | ~/.sbt @@ -114,10 +114,10 @@ jobs: ~/.cache/coursier/v1 ~/AppData/Local/Coursier/Cache/v1 ~/Library/Caches/Coursier/v1 - key: ${{ runner.os }}-sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }} + key: ${{ runner.os }}-sbt-cache-v3-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }} - name: Download target directories (2.12.14) - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v3 with: name: target-${{ matrix.os }}-2.12.14-${{ matrix.java }} diff --git a/src/sbt-test/sbtghactions/suppressed-scala-version/expected-ci.yml b/src/sbt-test/sbtghactions/suppressed-scala-version/expected-ci.yml index 9c88249..84a7aa4 100644 --- a/src/sbt-test/sbtghactions/suppressed-scala-version/expected-ci.yml +++ b/src/sbt-test/sbtghactions/suppressed-scala-version/expected-ci.yml @@ -28,19 +28,19 @@ jobs: runs-on: ${{ matrix.os }} steps: - name: Checkout current branch (full) - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: fetch-depth: 0 - name: Setup Java (temurin@11) if: matrix.java == 'temurin@11' - uses: actions/setup-java@v2 + uses: actions/setup-java@v3 with: distribution: temurin java-version: 11 - name: Cache sbt - uses: actions/cache@v2 + uses: actions/cache@v3 with: path: | ~/.sbt @@ -49,7 +49,7 @@ jobs: ~/.cache/coursier/v1 ~/AppData/Local/Coursier/Cache/v1 ~/Library/Caches/Coursier/v1 - key: ${{ runner.os }}-sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }} + key: ${{ runner.os }}-sbt-cache-v3-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }} - name: Check that workflows are up to date run: sbt ++${{ matrix.scala }} githubWorkflowCheck @@ -61,7 +61,7 @@ jobs: run: tar cf targets.tar target project/target - name: Upload target directories - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: target-${{ matrix.os }}-${{ matrix.scala }}-${{ matrix.java }} path: targets.tar @@ -78,19 +78,19 @@ jobs: runs-on: ${{ matrix.os }} steps: - name: Checkout current branch (full) - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: fetch-depth: 0 - name: Setup Java (temurin@11) if: matrix.java == 'temurin@11' - uses: actions/setup-java@v2 + uses: actions/setup-java@v3 with: distribution: temurin java-version: 11 - name: Cache sbt - uses: actions/cache@v2 + uses: actions/cache@v3 with: path: | ~/.sbt @@ -99,10 +99,10 @@ jobs: ~/.cache/coursier/v1 ~/AppData/Local/Coursier/Cache/v1 ~/Library/Caches/Coursier/v1 - key: ${{ runner.os }}-sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }} + key: ${{ runner.os }}-sbt-cache-v3-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }} - name: Download target directories (2.13.6) - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v3 with: name: target-${{ matrix.os }}-2.13.6-${{ matrix.java }} diff --git a/src/test/scala/sbtghactions/GenerativePluginSpec.scala b/src/test/scala/sbtghactions/GenerativePluginSpec.scala index a6adbb0..c1d4b4f 100644 --- a/src/test/scala/sbtghactions/GenerativePluginSpec.scala +++ b/src/test/scala/sbtghactions/GenerativePluginSpec.scala @@ -484,7 +484,7 @@ class GenerativePluginSpec extends Specification { - run: echo hello - name: Checkout current branch (fast) - uses: actions/checkout@v2""" + uses: actions/checkout@v3""" } "compile a job with one step and three oses" in { @@ -533,7 +533,7 @@ class GenerativePluginSpec extends Specification { steps: - name: Setup Java (temurin@11) if: matrix.java == 'temurin@11' - uses: actions/setup-java@v2 + uses: actions/setup-java@v3 with: distribution: temurin java-version: 11 @@ -700,7 +700,7 @@ class GenerativePluginSpec extends Specification { - run: echo $${{ matrix.test }} - name: Checkout current branch (fast) - uses: actions/checkout@v2""" + uses: actions/checkout@v3""" } "compile a job with extra runs-on labels" in { @@ -899,7 +899,7 @@ class GenerativePluginSpec extends Specification { - run: echo hello - name: Checkout current branch (fast) - uses: actions/checkout@v2""" + uses: actions/checkout@v3""" } }