From 97ecc2e7f1410a33d99f9bcd12cbbc02eeecc1be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Koz=C5=82owski?= Date: Fri, 3 Dec 2021 04:24:47 +0100 Subject: [PATCH] Skip native image / publish on non-tags --- .github/workflows/ci.yml | 8 +++----- build.sbt | 7 +++---- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9cd2a5da..0c069500 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -117,7 +117,7 @@ jobs: publish-native: name: Publish native images needs: [build] - if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main') + if: startsWith(github.ref, 'refs/tags/') strategy: matrix: os: [macos-10.15] @@ -157,12 +157,10 @@ jobs: tar xf targets.tar rm targets.tar - - if: startsWith(github.ref, 'refs/tags/') - run: sbt ++${{ matrix.scala }} nativeImage + - run: sbt ++${{ matrix.scala }} nativeImage - run: mv target/native-image/spotify-next target/native-image/spotify-next-${{ matrix.os }} - - if: startsWith(github.ref, 'refs/tags/') - uses: softprops/action-gh-release@v1 + - uses: softprops/action-gh-release@v1 with: files: target/native-image/spotify-next diff --git a/build.sbt b/build.sbt index eb66a55e..b6c80558 100644 --- a/build.sbt +++ b/build.sbt @@ -38,12 +38,12 @@ ThisBuild / githubWorkflowGeneratedCI ~= { id = "publish-native", name = "Publish native images", oses = List("macos-10.15"), + cond = Some("startsWith(github.ref, 'refs/tags/')"), steps = job.steps.flatMap { case step if step.id.contains("release") => List( WorkflowStep.Sbt( - List("nativeImage"), - cond = Some("startsWith(github.ref, 'refs/tags/')") + List("nativeImage") ), WorkflowStep.Run( List( @@ -52,8 +52,7 @@ ThisBuild / githubWorkflowGeneratedCI ~= { ), WorkflowStep.Use( UseRef.Public("softprops", "action-gh-release", "v1"), - params = Map("files" -> "target/native-image/spotify-next"), - cond = Some("startsWith(github.ref, 'refs/tags/')") + params = Map("files" -> "target/native-image/spotify-next") ) ) case step =>