-
Notifications
You must be signed in to change notification settings - Fork 0
/
appveyor.yml
110 lines (97 loc) · 3.89 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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
#--------------------------------------------------
# Build worker image (VM template)
#--------------------------------------------------
image: Visual Studio 2017
#--------------------------------------------------
# Environment
#--------------------------------------------------
environment:
GITHUB_PERSONAL_ACCESS_TOKEN:
secure: PNVFwcCuNr+X7SffsiwiVsa/JzVyZqwNJUbeve+Or/EjOwZxbd1CUC0K/5az9jsT
GIT_CONFIG_USER_EMAIL:
secure: yAZjzbVhtfeKof5pGJ/N65IjSffBIJoX5MZIpqbtHkc=
#--------------------------------------------------
# Branch whitelist
#--------------------------------------------------
branches:
# Whitelist
only:
- master
# Do not build on tags, since we auto-commit tags.
skip_tags: true
#--------------------------------------------------
# After cloning repository
#--------------------------------------------------
install:
- git submodule init
- git submodule update
#--------------------------------------------------
# Build configuration
#--------------------------------------------------
configuration: Release
#--------------------------------------------------
# Build hooks - before
#--------------------------------------------------
before_build:
# Patch version in csproj
- ps: $temp_path = (Get-Item src\$env:APPVEYOR_PROJECT_NAME\$env:APPVEYOR_PROJECT_NAME.csproj).FullName
- ps: $temp_csproj = [xml](Get-Content $temp_path)
- ps: $temp_csproj.Project.PropertyGroup.Version = $temp_csproj.Project.PropertyGroup.Version -replace '\.[0-9]+$', ".$env:APPVEYOR_BUILD_NUMBER"
- ps: $temp_csproj.Save($temp_path)
- ps: $env:APPVEYOR_BUILD_VERSION = $temp_csproj.Project.PropertyGroup.Version
- ps: Write-Host "Build version set to - $env:APPVEYOR_BUILD_VERSION"
# Restore
- dotnet restore
#--------------------------------------------------
# Testing
# TODO: Figure out how to work with just the assembly output.
#--------------------------------------------------
test_script:
- dotnet test test\%APPVEYOR_PROJECT_NAME%.Tests\%APPVEYOR_PROJECT_NAME%.Tests.csproj
#--------------------------------------------------
# Build hooks - after
#--------------------------------------------------
after_build:
# NOTE: "dotnet pack" is not supported yet, as per
# https://github.com/NuGet/Home/issues/4491
- msbuild /t:pack src\%APPVEYOR_PROJECT_NAME%\%APPVEYOR_PROJECT_NAME%.csproj
#--------------------------------------------------
# Build hooks - on_success
#
# Tags the repository in GitHub with the release version.
#--------------------------------------------------
on_success:
- git config --global credential.helper store
- ps: Add-Content "$env:USERPROFILE\.git-credentials" "https://$($env:GITHUB_PERSONAL_ACCESS_TOKEN):x-oauth-basic@github.com`n"
- git config --global user.email "%GIT_CONFIG_USER_EMAIL%"
- git config --global user.name "One Frame Link"
- git tag "v%APPVEYOR_BUILD_VERSION%"
- git push origin "v%APPVEYOR_BUILD_VERSION%"
#--------------------------------------------------
# NuGet config
#--------------------------------------------------
nuget:
# disable publishing of .nupkg artifacts to
# account/project feeds for pull request builds
disable_publish_on_pr: true
#--------------------------------------------------
# Artifact configuration
#--------------------------------------------------
artifacts:
- path: '**\$(APPVEYOR_PROJECT_NAME).$(APPVEYOR_BUILD_VERSION).nupkg'
name: NuGet
#--------------------------------------------------
# Deploy NuGet
#--------------------------------------------------
deploy:
provider: NuGet
api_key:
secure: iWmbE8LWn4ChIhbo5eOvSctKGvET9G/ZCHJLmuAawyAGq2H4f0OySO3GSpvyI7tS
artifact: NuGet
#--------------------------------------------------
# Notifications
#--------------------------------------------------
notifications:
- provider: Slack
incoming_webhook:
secure: Y4pw1Q3aqUk/4aVYHN5R3u5Zca5ijyVi6tRAVahXhlFXFCZTwpJLrEwHsRGoqQGIkUUpAOvlOpVRNoXBKJhfwkHybRotzfi7SbbB8Rb+67I=