-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathappveyor.yml
64 lines (46 loc) · 1.72 KB
/
appveyor.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
version: "{build}"
image: Visual Studio 2019
configuration: Release
platform: Any CPU
clone_depth: 1
cache:
- packages -> src\packages.config
install:
- ps: >-
$env:BUILD_VERSION = Select-String -Path src\Properties\AssemblyInfo.cs -Pattern 'AssemblyFileVersion\(\"(.*)\"\)' | %{ $_.Matches[0].Groups[1].Value }
If ($env:APPVEYOR_REPO_TAG -eq $true) {
$env:BUILD_VERSION = $env:APPVEYOR_REPO_TAG_NAME.TrimStart("v")
}
$env:BUILD_VERSION_FILE = "$env:BUILD_VERSION.$env:APPVEYOR_BUILD_NUMBER"
Update-AppveyorBuild -Version $env:BUILD_VERSION_FILE
$version = $env:BUILD_VERSION -split '-'
$env:BUILD_VERSION_FRIENDLY = $version[0] -replace "(\.0)$"
If ($version[1]) {
$env:BUILD_VERSION_FILE = "$($version[0]).$env:APPVEYOR_BUILD_NUMBER"
Update-AppveyorBuild -Version "$env:BUILD_VERSION_FILE-$($version[1])"
$end = (Get-Culture).TextInfo.ToTitleCase($version[1].Replace("rc", "RC"))
$env:BUILD_VERSION_FRIENDLY += " " + $end -replace "([a-z]+)(\d+)",'$1 $2'
}
$env:BUILD_VERSION_FRIENDLY += " Build $env:APPVEYOR_BUILD_NUMBER"
assembly_info:
patch: true
file: src\Properties\AssemblyInfo.cs
assembly_version: $(BUILD_VERSION)
assembly_file_version: $(BUILD_VERSION_FILE)
assembly_informational_version: $(BUILD_VERSION_FRIENDLY)
before_build:
- nuget restore
build:
project: LogViewer.sln
verbosity: minimal
after_build:
- ps: Get-ChildItem src\bin\Release\*.exe | Rename-Item -NewName { $_.name -replace " ", "" }
artifacts:
- path: src\bin\Release\NFiveLogViewer.exe
deploy:
- provider: GitHub
release: $(APPVEYOR_REPO_TAG_NAME)
auth_token:
secure: 11Aj9GejhzBxJlpQAwmcgJKINliGVNQ/mWTTFZCylmKiwglzys7hWxRZiRfT7INp
on:
APPVEYOR_REPO_TAG: true