Skip to content

Commit

Permalink
Skip native image / publish on non-tags
Browse files Browse the repository at this point in the history
  • Loading branch information
kubukoz committed Dec 3, 2021
1 parent fb8c131 commit 97ecc2e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
8 changes: 3 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down Expand Up @@ -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
7 changes: 3 additions & 4 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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 =>
Expand Down

0 comments on commit 97ecc2e

Please sign in to comment.