-
Notifications
You must be signed in to change notification settings - Fork 19
/
appveyor.yml
65 lines (51 loc) · 2 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
version: 1.0.{build}
configuration: Release
image:
- Visual Studio 2017
environment:
GitHubOrganisation: TestStack
GitHubToken:
secure: cBxvAtTgSlWVblTXtx8QKygh2HQeYZ9i0plMjJzCTNInGCm1XyG+nrSs18qUtC8W
before_build:
- ps: >-
dotnet restore
dotnet tool install -g GitVersion.Tool --version 4.0.1-beta1-58
dotnet gitversion /output buildserver
npm install github-release-notes -g
build_script:
- ps: dotnet build --source "**/*.csproj" --configuration Release --verbosity minimal -p:VersionPrefix="$Env:GitVersion_NuGetVersion" -p:FileVersion="$Env:GitVersion_AssemblySemFileVer" -p:InformationalVersion="$Env:GitVersion_InformationalVersion"
after_build:
- ps: >-
dotnet pack $Env:APPVEYOR_PROJECT_NAME/$Env:APPVEYOR_PROJECT_NAME.csproj --configuration Release /p:PackageVersion="$Env:GitVersion_NuGetVersion" --no-build --output "$Env:APPVEYOR_BUILD_FOLDER" --include-symbols
$currentCommitIsTagged = git tag -l --points-at HEAD
$HTTP_Request = [System.Net.WebRequest]::Create("https://api.github.com/repos/$env:GitHubOrganisation/$env:APPVEYOR_PROJECT_NAME/releases/tags/$Env:GitVersion_NuGetVersion")
$HTTP_Request.UserAgent = "Powershell"
try {
$HTTP_Request.GetResponse()
} catch [Net.WebException] {
[System.Net.HttpWebResponse] $resp = [System.Net.HttpWebResponse] $_.Exception.Response
$noExistingGitHubRelease = $resp.StatusCode -eq 404
if ($currentCommitIsTagged -And $noExistingGitHubRelease) {
$env:SHOULD_DEPLOY = 'true'
}
}
test:
assemblies:
only:
- '**\*.*Tests.dll'
artifacts:
- path: '*.nupkg'
deploy:
- provider: NuGet
api_key:
secure: VwHQFq0vD5vJNiUtsZMgUYdw2tVfXJfWh++eHC2LyEMvQzWiESWy2yBwQajzYAjo
on:
SHOULD_DEPLOY: true
after_deploy:
- ps: >-
gren release --token=$env:GitHubToken --username=$env:GitHubOrganisation --repo=$env:APPVEYOR_PROJECT_NAME
notifications:
- provider: GitHubPullRequest
on_build_success: true
on_build_failure: true
on_build_status_changed: false