Skip to content

Commit 50016c0

Browse files
authored
update release build script
1 parent d0a3f33 commit 50016c0

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

.github/workflows/ci-release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# If this file is renamed, the incrementing run attempt number will be reset.
22

3-
name: CI
3+
name: Release
44

55
on:
66
push:

Build.ps1

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,12 @@ $revision = $NULL -ne $env:CI_BUILD_NUMBER ? "{0:00000}" -f [Convert]::ToInt32("
1919

2020
# add a suffix if this is not a tag build
2121
$suffix = $NULL -ne $env:CI_COMMIT_TAG ? "" : "$($branch.Substring(0, [Math]::Min(10,$branch.Length)) -replace '([^a-zA-Z0-9\-]*)', '')-$revision"
22-
$prefix = $NULL -ne $env:CI_COMMIT_TAG ? $env:CI_COMMIT_TAG : $NULL
23-
24-
Write-Output $brach
25-
Write-Output $revision
26-
Write-Output $suffix
27-
28-
Write-Output "build: Package version suffix is $suffix"
22+
$prefix = $env:CI_COMMIT_TAG
2923

24+
Write-Output "build: Branch: $brach"
25+
Write-Output "build: Revision: $revision"
26+
Write-Output "build: VersionPrefix: $prefix"
27+
Write-Output "build: VersionSuffix: $suffix"
3028

3129
foreach ($src in Get-ChildItem src/*) {
3230
Push-Location $src
@@ -67,8 +65,8 @@ foreach ($test in Get-ChildItem test/*.Tests) {
6765
Pop-Location
6866

6967
if ($env:NUGET_API_KEY `
70-
-and ($NULL -ne $suffix -or $NULL -ne $prefix) `
71-
-and ($env:CI_TARGET_BRANCH -eq "dev" -or $env:CI_TARGET_BRANCH -eq "master")) {
68+
-and (("tag" -eq $env:GITHUB_REF_NAME -and $NULL -ne $prefix) `
69+
-or ($NULL -ne $suffix -and ($env:CI_TARGET_BRANCH -eq "dev" -or $env:CI_TARGET_BRANCH -eq "master")))) {
7270
# GitHub Actions will only supply this to branch builds and not PRs. We publish
7371
# builds from any branch this action targets (i.e. master and dev).
7472

@@ -79,4 +77,6 @@ if ($env:NUGET_API_KEY `
7977
& dotnet nuget push -k $env:NUGET_API_KEY -s https://api.nuget.org/v3/index.json "$nupkg" --no-symbols
8078
if($LASTEXITCODE -ne 0) { throw "Publishing failed" }
8179
}
80+
} else {
81+
Write-Output "build: Skipping Nuget publish"
8282
}

0 commit comments

Comments
 (0)