forked from MasterDevs/ChromeDevTools
-
Notifications
You must be signed in to change notification settings - Fork 4
/
appveyor.yml
94 lines (84 loc) · 2.96 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
# Great reference: http://www.appveyor.com/docs/appveyor-yml
version: 1.0.{build}
skip_tags: false
configuration: Release
init:
- ps: >-
$parsedReleaseBuildVersion = $env:APPVEYOR_REPO_TAG_NAME -Match "(\d+.\d+.\d+(.\d+)?)"
If($env:appveyor_repo_tag -AND $parsedReleaseBuildVersion) {
$env:BuildVersion = $matches[0]
$env:IsGithubRelease = $TRUE
}
else {
$env:BuildVersion = $env:appveyor_build_version
$env:IsGithubRelease = ""
}
Write-Host "Build Version: " $env:BuildVersion
Write-Host "appveyor_build_version Variable: " $env:appveyor_build_version
install:
- ps: >-
try
{
if($env:IsGithubRelease)
{
$origin = git config --get remote.origin.url
if ($origin -like "https://github.com/*.git")
{
$startToTrim = "https://github.com/"
$endToTrim = ".git"
$releaseUrl = $origin.Substring($startToTrim.Length, $origin.Length - $startToTrim.Length - $endToTrim.Length)
$releaseUrl = "https://api.github.com/repos/" + $releaseUrl + "/releases/tags/" + $env:APPVEYOR_REPO_TAG_NAME
$resp = invoke-webrequest $releaseUrl
$release = $resp.Content | ConvertFrom-Json
$nuspecPath = (Get-ChildItem -Filter *.nuspec -Recurse )[0].FullName
[xml]$nuspec = Get-Content $nuspecPath
$nuspec.package.metadata.releaseNotes = $release.Body
$nuspec.Save( $nuspecPath )
}
}
}
catch
{
Write-Host $_.Exception.GetType().FullName, $_.Exception.Message
}
assembly_info:
patch: true
file: '**\AssemblyInfo.*'
assembly_version: $(BuildVersion)
assembly_file_version: $(BuildVersion)
assembly_informational_version: $(BuildVersion)
nuget:
account_feed: true
project_feed: true
before_build:
- cmd: choco install wget
- wget -q https://download.microsoft.com/download/8/F/9/8F9659B9-E628-4D1A-B6BF-C3004C8C954B/dotnet-1.1.1-sdk-win-x64.exe
- dotnet-1.1.1-sdk-win-x64.exe /install /quiet /log dotnetinstall.log
- ps: Push-AppveyorArtifact "dotnetinstall.log"
- nuget restore source\MasterDevs.ChromeDevTools.sln
- dotnet restore source\ChromeDevTools\MasterDevs.ChromeDevTools.Core.csproj
- dotnet pack source\ChromeDevTools\MasterDevs.ChromeDevTools.Core.csproj --version-suffix r%APPVEYOR_BUILD_NUMBER%
build:
project: source\MasterDevs.ChromeDevTools.sln
publish_nuget: true
publish_nuget_symbols: false
verbosity: minimal
artifacts:
- path: '*.nupkg'
- path: 'source\ChromeDevTools\bin\Release\*.nupkg'
deploy:
- provider: GitHub
auth_token:
secure: HId6RsZYqcrDw7vR0mRVLglD1GrOSg59tuVuoUpMFWkNlBrUki2TEob9grqsyiWO
artifact:
prerelease: false
on:
branch: master
IsGithubRelease: true
- provider: NuGet
api_key:
secure: leT7MLGh5JT4dC5wyCb7wrg5ocQrHljDoSZiuSQO+vF0icNX1OUgjhI7m2qHlxh1
artifact:
on:
branch: master
IsGithubRelease: true