-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #36 from grahamegrieve/allow-v.#.#.#-releases
Allow v.#.#.# releases
- Loading branch information
Showing
1 changed file
with
12 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,11 +18,15 @@ jobs: | |
run: | | ||
# Validate that the version used in the release is one that'll work with all of our tooling | ||
# Squirrel can be picky: https://github.com/Squirrel/Squirrel.Windows/issues/1394 | ||
[ValidatePattern("^(?<Version>\d+(\s*\.\s*\d+){0,3})(?<Release>-[a-z][0-9a-z-]*)?$" ` | ||
# ErrorMessage not yet supported in Github's powershell | ||
# , ErrorMessage = 'The release version is not valid with all of our tooling.' ` | ||
)][string]$version = $env:TAG_NAME | ||
if ($env:TAG_NAME -match "^v(?<Version>\d+(\s*\.\s*\d+){0,3})(?<Release>-[a-z][0-9a-z-]*)?$") { | ||
$SHORT_TAG_NAME = $Matches.Version | ||
} else { | ||
echo "$env:TAG_NAME isn't a valid release name - make sure it matches v#.#.#" | ||
exit 1 | ||
} | ||
Write-Output "::set-env name=SHORT_TAG_NAME::${SHORT_TAG_NAME}" | ||
- name: Setup .NET Core SDK | ||
uses: actions/[email protected] | ||
|
@@ -43,7 +47,7 @@ jobs: | |
shell: powershell | ||
run: | | ||
$regex = 'Assembly(File)?Version\(".+?"\)' | ||
$replacement = "Assembly`$1Version(`"$env:TAG_NAME`")" | ||
$replacement = "Assembly`$1Version(`"$env:SHORT_TAG_NAME`")" | ||
$assemblyinfo = "ClinicArrivals\Properties\AssemblyInfo.cs" | ||
# Ideally this uses Resolve-Path -Path "*\*\AssemblyInfo.cs" | Get-Content | ||
|
@@ -75,10 +79,10 @@ jobs: | |
$Script:NuSpec = "$env:WORKSPACEGIT\ClinicArrivals.nuspec" | ||
nuget pack "$Script:NuSpec" -Version "$env:TAG_NAME" ` | ||
nuget pack "$Script:NuSpec" -Version "$env:SHORT_TAG_NAME" ` | ||
-BasePath $SQUIRRELWIN -OutputDirectory $SQUIRRELWIN | ||
$Script:NupkgPath = "$SQUIRRELWIN\ClinicArrivals.$env:TAG_NAME.nupkg" | ||
$Script:NupkgPath = "$SQUIRRELWIN\ClinicArrivals.$env:SHORT_TAG_NAME.nupkg" | ||
if (-not (Test-Path -Path $Script:NupkgPath -PathType Leaf)) { | ||
Write-Output "ERROR: nupkg doesn't exist as expected! Build aborted." | ||
|