-
Notifications
You must be signed in to change notification settings - Fork 1
/
appveyor.yml
100 lines (88 loc) · 4.07 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
# version format
version: v{build}
branches:
only:
- master
- deployment
# Skipping commits with particular message or from specific user
skip_commits:
message: "*[skip ci]*"
image: Visual Studio 2019
# scripts that are called at very beginning, before repo cloning
init:
- git config --global core.autocrlf input
environment:
package_token:
secure: 95GbzPvGGiBrNF4Ymi2UXoCoTljv9YUUi1uerCmrQA8WqvJpvs+oFw+KqJcK6nqv
matrix:
fast_finish: true # set this flag to immediately finish build once one of the jobs fails.
before_build:
- ps: (Get-Content nuget.config).replace('Insert token here', $env:package_token) | Set-Content nuget.config
- nuget restore %APPVEYOR_PROJECT_NAME%.sln
- nuget install GitCommitId -DependencyVersion Highest -OutputDirectory packages
- |-
printf "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" > build_all.xml
printf " <Project xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n" >> build_all.xml
printf " <Target Name=\"Build\">\n" >> build_all.xml
printf " <MSBuild Projects=\"%APPVEYOR_PROJECT_NAME%.sln\" Properties=\"Configuration=Debug;Platform=x64\"/>\n" >> build_all.xml
printf " <MSBuild Projects=\"%APPVEYOR_PROJECT_NAME%.sln\" Properties=\"Configuration=Release;Platform=x64\"/>\n" >> build_all.xml
printf " </Target>\n" >> build_all.xml
printf "</Project>\n" >> build_all.xml
build:
project: build_all.xml
after_build:
- nuget install Packager -DependencyVersion Highest -OutputDirectory packages # Install Packager
- ps: $folder = Get-ChildItem -Path packages/Packager.* -Name | Out-String # Get the installation folder (we don't know the actual version)
- ps: $firstline = ($folder -split '\r\n')[0] # Get rid of carriage-return
- ps: $fullpath = ".\packages\$firstline\lib\net48\Packager.exe" # Build full path
- ps: $env:PACKAGER_PATH=$fullpath
- '%PACKAGER_PATH% %CUSTOM_PACKAGER_OPTIONS%' # Execute the packager: the output is nuget\%APPVEYOR_PROJECT_NAME%.nuspec
- if exist nuget\%APPVEYOR_PROJECT_NAME%.nuspec nuget pack nuget\%APPVEYOR_PROJECT_NAME%.nuspec
- '%PACKAGER_PATH% %CUSTOM_PACKAGER_OPTIONS% --debug' # Execute the packager: the output is nuget-debug\%APPVEYOR_PROJECT_NAME%-Debug.nuspec
- if exist nuget-debug\%APPVEYOR_PROJECT_NAME%-Debug.nuspec nuget pack nuget-debug\%APPVEYOR_PROJECT_NAME%-Debug.nuspec
- ps: |-
$xml = [xml](Get-Content .\$env:APPVEYOR_PROJECT_NAME\$env:APPVEYOR_PROJECT_NAME.csproj)
- ps: $version = $xml.Project.PropertyGroup.Version
- ps: set version_tag v$version
- ps: $version_tag = $version_tag -replace ' ',''
- ps: $env:VERSION_TAG=$version_tag
- echo "Version is %VERSION_TAG%"
test: off
artifacts:
- path: $(APPVEYOR_PROJECT_NAME)/bin/x64/Release/net48/$(APPVEYOR_PROJECT_NAME).dll
name: $(APPVEYOR_PROJECT_NAME)
- path: $(APPVEYOR_PROJECT_NAME)-Debug.*.nupkg
name: $(APPVEYOR_PROJECT_NAME)-Package-Debug
type: NuGetPackage
- path: $(APPVEYOR_PROJECT_NAME).*.nupkg
name: $(APPVEYOR_PROJECT_NAME)-Package-Release
type: NuGetPackage
deploy:
- provider: GitHub
release: $(VERSION_TAG)
description: 'Automatic deployment'
auth_token:
secure: rICJyZFx5ejL3OOw1IgzSG9AL8qKZGi79bSvkoqxLje7HWRckXTyr4Y24hVNno6t
artifact: $(APPVEYOR_PROJECT_NAME)
draft: false
prerelease: false
on:
branch: deployment
- provider: NuGet
server: https://nuget.pkg.github.com/dlebansais/index.json
symbol_server: https://nuget.pkg.github.com/dlebansais/index.json
artifact: $(APPVEYOR_PROJECT_NAME)-Package-Debug
username: dlebansais
api_key:
secure: GZGy3nOU2PstP5qqBJ3xRNo4X9mywcmtoF6iO9JlOPgxksM+QkVjQdR+nJ62+76n
on:
branch: deployment
- provider: NuGet
server: https://nuget.pkg.github.com/dlebansais/index.json
artifact: $(APPVEYOR_PROJECT_NAME)-Package-Release
skip_symbols: true
username: dlebansais
api_key:
secure: GZGy3nOU2PstP5qqBJ3xRNo4X9mywcmtoF6iO9JlOPgxksM+QkVjQdR+nJ62+76n
on:
branch: deployment