From 1373dbca0fe423a3cc895968cd883b966baa033c Mon Sep 17 00:00:00 2001 From: oxffaa Date: Fri, 8 Jan 2021 23:38:29 +0700 Subject: [PATCH] remake publish on release --- .../{publish-on-push-tag.yml => publish-on-release.yml} | 7 +++---- build/Build.cs | 3 +-- build/_build.csproj | 3 +++ 3 files changed, 7 insertions(+), 6 deletions(-) rename .github/workflows/{publish-on-push-tag.yml => publish-on-release.yml} (85%) diff --git a/.github/workflows/publish-on-push-tag.yml b/.github/workflows/publish-on-release.yml similarity index 85% rename from .github/workflows/publish-on-push-tag.yml rename to .github/workflows/publish-on-release.yml index 5921dec..fbaa6db 100644 --- a/.github/workflows/publish-on-push-tag.yml +++ b/.github/workflows/publish-on-release.yml @@ -1,9 +1,8 @@ -name: Publish on push tags on master +name: Publish package on release on: - push: - tags: - - 'v*' + release: + types: [published] jobs: build: diff --git a/build/Build.cs b/build/Build.cs index 9fd1b71..4f001af 100644 --- a/build/Build.cs +++ b/build/Build.cs @@ -116,11 +116,10 @@ class Build : NukeBuild Target Publish => _ => _ .DependsOn(Pack) .Consumes(Pack) - .OnlyWhenStatic(() => GitHasCleanWorkingCopy()) - .OnlyWhenDynamic(() => GitCurrentBranch() == "master") .Requires(() => NugetApiKey) .Requires(() => NugetFeed) .Requires(() => Configuration.Equals(Configuration.Release)) + .Requires(() => GitHasCleanWorkingCopy()) .Executes(() => { DotNetNuGetPush(_ => _ diff --git a/build/_build.csproj b/build/_build.csproj index b071fc6..89e6cc8 100644 --- a/build/_build.csproj +++ b/build/_build.csproj @@ -24,6 +24,9 @@ ci\master-build-and-test.yml + + ci\publish-on-release.yml +