Skip to content

Commit

Permalink
Update AppVeyor build to patch AssemblyInfo version
Browse files Browse the repository at this point in the history
  • Loading branch information
t1m0thyj committed Dec 24, 2020
1 parent ef15e73 commit eb72283
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions appveyor.yml
Expand Up @@ -2,20 +2,14 @@ version: 1.0.{build}
skip_branch_with_pr: true
image: Visual Studio 2019
configuration: Release
init:
- ps: "$assemblyFile = \"$env:APPVEYOR_BUILD_FOLDER\\src\\Properties\\AssemblyInfo.cs\"\n\n$regex = new-object System.Text.RegularExpressions.Regex ('(AssemblyVersion(Attribute)?\\s*\\(\\s*\\\")(.*)(\\\"\\s*\\))', \n [System.Text.RegularExpressions.RegexOptions]::MultiLine)\n\n$content = [IO.File]::ReadAllText($assemblyFile)\n\n$version = $null\n$match = $regex.Match($content)\nif($match.Success) {\n $version = $match.groups[3].value\n}\n\n# new version\n$version = \"$version.$env:APPVEYOR_BUILD_NUMBER\"\n\n# update assembly info\n$content = $regex.Replace($content, '${1}' + $version + '${4}')\n[IO.File]::WriteAllText($assemblyFile, $content)\n\n# update AppVeyor build\nUpdate-AppveyorBuild -Version $version"
environment:
UseTemporarySignCert: true
install:
- ps: choco install innosetup -y -r
before_build:
- ps: >-
if ($env:APPVEYOR_REPO_TAG -eq "true") {
Update-AppveyorBuild -Version "$($env:APPVEYOR_REPO_TAG_NAME.TrimStart("v"))"
} else {
Update-AppveyorBuild -Version "dev-$($env:APPVEYOR_REPO_COMMIT.Substring(0, 7))"
}
nuget restore src\WinDynamicDesktop.sln
- ps: nuget restore src\WinDynamicDesktop.sln
build:
verbosity: minimal
after_build:
Expand Down

0 comments on commit eb72283

Please sign in to comment.