Skip to content

Commit 3924daa

Browse files
committed
ci: Adjust conditons in YAMl to prevent GitHub draft release from being created for release branches where a non-draft release is created
1 parent 16be15e commit 3924daa

File tree

1 file changed

+8
-20
lines changed

1 file changed

+8
-20
lines changed

azure-pipelines.yml

Lines changed: 8 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,6 @@
1414
# - Assumes a Service Connection for NuGet was set up in the Team project running the pipeline
1515
# - The name of the service connection is stored in the variable nuget_org_ServiceConnectionName (defined below)
1616
# - The variable nuget_org_PackageName defines which package is produced by the pipeline
17-
# - Whether this step runs can be controlled by the variable 'Settings.PublishToNuGetOrg' (modify at queue time when necessary):
18-
# - 'auto' or empty: Run when building a release branch
19-
# - 'false': Do not run
20-
# - 'true': Run regardless of the current branch
2117
# - Create_GitHub_Release
2218
# - Creates a GitHub release for the build
2319
# - Only runs if the build was published to NuGet.org
@@ -181,19 +177,7 @@ jobs:
181177
and
182178
(
183179
succeeded('Build_and_Test'),
184-
not(eq(variables['Settings.PublishToNuGetOrg'], 'false')),
185-
or(
186-
eq(variables['Settings.PublishToNuGetOrg'], 'true'),
187-
and
188-
(
189-
startsWith(variables['Build.SourceBranch'], 'refs/heads/release/'),
190-
or
191-
(
192-
eq(variables['Settings.PublishToNuGetOrg'], ''),
193-
eq(variables['Settings.PublishToNuGetOrg'], 'auto')
194-
)
195-
)
196-
)
180+
startsWith(variables['Build.SourceBranch'], 'refs/heads/release/')
197181
)
198182
steps:
199183
# Get artifacts
@@ -220,7 +204,12 @@ jobs:
220204
dependsOn:
221205
- Build_and_Test
222206
- Publish_to_NuGet_org
223-
condition: succeeded('Publish_to_NuGet_org')
207+
condition: |
208+
and
209+
(
210+
succeeded('Publish_to_NuGet_org'),
211+
startsWith(variables['Build.SourceBranch'], 'refs/heads/release/')
212+
)
224213
steps:
225214

226215
# Install .NET Core SDK and runtime (version specified in global.json)
@@ -281,8 +270,7 @@ jobs:
281270
# Only run if build was successful and a package was uploaded to nuget.org
282271
dependsOn:
283272
- Build_and_Test
284-
- Publish_to_MyGet
285-
condition: succeeded('Publish_to_MyGet')
273+
condition: eq(variables['build.sourceBranch'], 'refs/heads/master')
286274
steps:
287275

288276
# Install .NET Core SDK and runtime (version specified in global.json)

0 commit comments

Comments
 (0)