Skip to content

Commit 571febb

Browse files
committed
Update publish.yml
1 parent 4567de0 commit 571febb

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

.github/workflows/publish.yml

-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ jobs:
1111
runs-on: windows-latest
1212
steps:
1313
- uses: actions/checkout@v3
14-
with:
15-
fetch-depth: 0
1614
- name: Publish
1715
run: ./build.cmd test publish
1816
env:

build-support/nuke-build/Build.Publish.cs

+4-2
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,10 @@ public partial class Build
1515

1616
string TagVersion => GitRepository.Tags.SingleOrDefault(x => x.StartsWith("v"))?[1..];
1717

18+
bool IsTaggedBuild => !string.IsNullOrWhiteSpace(TagVersion);
19+
1820
Target Publish => _ => _
19-
.OnlyWhenDynamic(() => GitRepository.IsOnMainBranch() && !string.IsNullOrWhiteSpace(TagVersion))
21+
.OnlyWhenDynamic(() => GitRepository.IsOnMainBranch() && IsTaggedBuild)
2022
.DependsOn(Pack)
2123
.Requires(() => NuGetApiKey)
2224
.Executes(() =>
@@ -44,4 +46,4 @@ public partial class Build
4446
bool PushCompleteOnFailure => true;
4547
int PushDegreeOfParallelism => 5;
4648

47-
}
49+
}

0 commit comments

Comments
 (0)