Skip to content

Commit 97ecc2e

Browse files
committed
Skip native image / publish on non-tags
1 parent fb8c131 commit 97ecc2e

File tree

2 files changed

+6
-9
lines changed

2 files changed

+6
-9
lines changed

Diff for: .github/workflows/ci.yml

+3-5
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ jobs:
117117
publish-native:
118118
name: Publish native images
119119
needs: [build]
120-
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main')
120+
if: startsWith(github.ref, 'refs/tags/')
121121
strategy:
122122
matrix:
123123
os: [macos-10.15]
@@ -157,12 +157,10 @@ jobs:
157157
tar xf targets.tar
158158
rm targets.tar
159159
160-
- if: startsWith(github.ref, 'refs/tags/')
161-
run: sbt ++${{ matrix.scala }} nativeImage
160+
- run: sbt ++${{ matrix.scala }} nativeImage
162161

163162
- run: mv target/native-image/spotify-next target/native-image/spotify-next-${{ matrix.os }}
164163

165-
- if: startsWith(github.ref, 'refs/tags/')
166-
uses: softprops/action-gh-release@v1
164+
- uses: softprops/action-gh-release@v1
167165
with:
168166
files: target/native-image/spotify-next

Diff for: build.sbt

+3-4
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,12 @@ ThisBuild / githubWorkflowGeneratedCI ~= {
3838
id = "publish-native",
3939
name = "Publish native images",
4040
oses = List("macos-10.15"),
41+
cond = Some("startsWith(github.ref, 'refs/tags/')"),
4142
steps = job.steps.flatMap {
4243
case step if step.id.contains("release") =>
4344
List(
4445
WorkflowStep.Sbt(
45-
List("nativeImage"),
46-
cond = Some("startsWith(github.ref, 'refs/tags/')")
46+
List("nativeImage")
4747
),
4848
WorkflowStep.Run(
4949
List(
@@ -52,8 +52,7 @@ ThisBuild / githubWorkflowGeneratedCI ~= {
5252
),
5353
WorkflowStep.Use(
5454
UseRef.Public("softprops", "action-gh-release", "v1"),
55-
params = Map("files" -> "target/native-image/spotify-next"),
56-
cond = Some("startsWith(github.ref, 'refs/tags/')")
55+
params = Map("files" -> "target/native-image/spotify-next")
5756
)
5857
)
5958
case step =>

0 commit comments

Comments
 (0)