Skip to content

Commit e9643c1

Browse files
authored
Merge pull request #453 from nblumhardt/manual-ci-workflows
Allow CI workflows to be initiated manually
2 parents 8446d41 + 973f868 commit e9643c1

2 files changed

Lines changed: 14 additions & 2 deletions

File tree

.github/workflows/ci.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,18 @@ on:
77
branches: [ "dev", "main" ]
88
pull_request:
99
branches: [ "dev", "main" ]
10+
workflow_dispatch:
11+
inputs:
12+
publish:
13+
description: 'Publish a GitHub release'
14+
type: boolean
15+
required: true
16+
default: true
1017

1118
env:
1219
CI_BUILD_NUMBER_BASE: ${{ github.run_number }}
1320
CI_TARGET_BRANCH: ${{ github.head_ref || github.ref_name }}
14-
CI_PUBLISH: ${{ github.event_name == 'push' && github.ref_name == 'main' }}
21+
CI_PUBLISH: ${{ (github.event_name == 'push' && github.ref_name == 'main') || inputs.publish }}
1522

1623
jobs:
1724
build-windows:

build/Build.Windows.ps1

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,13 @@ function Upload-NugetPackages
111111
function Upload-GitHubRelease($version)
112112
{
113113
Write-Output "Creating release for version $version"
114+
115+
$prerelease = "";
116+
if ($env:CI_TARGET_BRANCH -ne "main") {
117+
$prerelease = "--prerelease ";
118+
}
114119

115-
iex "gh release create v$version --title v$version --generate-notes $(get-item ./artifacts/*)"
120+
iex "gh release create v$version --title v$version $prerelease--generate-notes $(get-item ./artifacts/*)"
116121
}
117122

118123
function Remove-GlobalJson

0 commit comments

Comments
 (0)