-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathappveyor.yml
95 lines (73 loc) · 3.24 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
configuration: Release
#platform: Any CPU
image: Visual Studio 2017
install:
- set PATH=C:\Ruby23\bin;%PATH%
- ps: $AllProtocols = [System.Net.SecurityProtocolType]'Ssl3,Tls,Tls11,Tls12'
- ps: "[System.Net.ServicePointManager]::SecurityProtocol = $AllProtocols"
- ps: mkdir c:\ca; iwr https://curl.haxx.se/ca/cacert.pem -outfile C:\ca\cacert.pem
- set SSL_CERT_FILE=C:\ca\cacert.pem
- ps: |
$build = $env:APPVEYOR_BUILD_NUMBER
$branch = $env:APPVEYOR_REPO_BRANCH
if ($env:APPVEYOR_REPO_TAG -eq "true") {
echo "Version: Using git tag $env:APPVEYOR_REPO_TAG_NAME"
if (-not $env:APPVEYOR_REPO_TAG -match "^(\d+\.\d+\.\d+)") {
throw "Invalid version in tag name"
}
$version = [version]$Matches[0]
$semver = $env:APPVEYOR_REPO_TAG_NAME
} else {
$semver = (git describe --abbrev=0 2>&1);
if ($LASTEXITCODE -ne 0) { $semver = "1.0.0-preview.0" };
echo "Version: Using base semver $semver"
$semver -match "^(\d+\.\d+\.\d+)"
$version = [version]$Matches[0]
$semver += ".$build"
if ($env:APPVEYOR_PULL_REQUEST_NUMBER) {
$semver += "+pr.$env:APPVEYOR_PULL_REQUEST_NUMBER"
} else {
$semver += "+$branch"
}
}
Set-AppveyorBuildVariable -Name "AssemblyMajor" -Value $version.Major
Update-AppVeyorBuild -Version "$semver"
- gem install chandler --no-document
- ps: set-content ~/.netrc "machine api.github.com login $env:github_username password $env:github_password" -encoding ascii
- ps: cp ~/.netrc ~/_netrc
- ps: if ($branch -eq "master" -And $isPullRequest -eq $False) {chandler push }
before_build:
- cmd: set PATH=C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin;C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\Bin;%PATH%
- cd src && nuget restore
nuget:
project_feed: true
disable_publish_on_pr: true
dotnet_csproj:
patch: true
file: '**\*.csproj'
version: '{version}'
assembly_version: $(AssemblyMajor).0.0.0
file_version: '{version}'
informational_version: '{version}'
build:
parallel: true
verbosity: minimal
publish_nuget: true
publish_nuget_symbols: true
include_nuget_references: true
after_build:
ps: |
$csprojPath = Resolve-Path WaterGunBeetles.Templates.CSharp\WaterGunBeetles.Templates.CSharp.csproj
$csproj = [xml](get-content $csprojPath)
$csproj.Project.ItemGroup.DotNetCliToolReference | ? { $_.Include -eq "WaterGunBeetles.Cli" } | % { $_.Version = $semver }
$csproj.Project.ItemGroup.PackageReference | ? { $_.Include -eq "WaterGunBeetles" } | % { $_.Version = $semver }
$csproj.Save($csprojPath)
nuget pack WaterGunBeetles.Templates.CSharp\.template.config\template.nuspec -Version $semver
artifacts:
- path: 'src\*.nupkg'
environment:
SSL_CERT_FILE: C:\ca\cacert.pem
github_username: serialseb
github_password:
secure:
1lXaOJ0GvCAOd0O9DDvVqw2eb7TvP2jve12u3hD2g4J7RVW2c2jC5XuRFyEuduUA