-
Notifications
You must be signed in to change notification settings - Fork 87
/
appveyor.yml
88 lines (72 loc) · 2.91 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
version: '{build}'
image:
- Visual Studio 2022
- Ubuntu
environment:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
DOTNET_CLI_TELEMETRY_OPTOUT: true
APPVEYOR_YML_DISABLE_PS_LINUX: false
BUILD_SUFFIX: ""
VERSION_SUFFIX: ""
configuration: Release
pull_requests:
do_not_increment_build_number: true
nuget:
disable_publish_on_pr: true
branches:
only:
- master
- /\d*\.\d*\.\d*/
init:
# Good practise, because Windows line endings are different from Unix/Linux ones
- ps: git config --global core.autocrlf true
- ps: $commitHash = $($env:APPVEYOR_REPO_COMMIT.substring(0,7));
- ps: $branch = $env:APPVEYOR_REPO_BRANCH;
- ps: $buildNumber = $env:APPVEYOR_BUILD_NUMBER;
- ps: $isRepoTag = $env:APPVEYOR_REPO_TAG;
- ps: $revision = $(If ($isRepoTag -eq "true") {[string]::Empty} Else {"{0:00000}" -f [convert]::ToInt32("0" + $buildNumber, 10)});
- ps: $suffix = $(If ([string]::IsNullOrEmpty($revision)) {[string]::Empty} Else {$branch.Substring(0, [math]::Min(10,$branch.Length))});
- ps: $env:BUILD_SUFFIX = $(If ([string]::IsNullOrEmpty($suffix)) {"$branch-$commitHash"} Else {"$suffix-$commitHash"});
- ps: $env:VERSION_SUFFIX = $(If ([string]::IsNullOrEmpty($suffix)) {[string]::Empty} Else {"--version-suffix=$suffix"});
install:
- ps: dotnet restore redmine-net-api.sln
before_build:
- ps: write-host "Is repo tag = $isRepoTag" -foregroundcolor Green
- ps: write-host "Build number = $buildNumber" -foregroundcolor Magenta
- ps: write-host "Branch = $branch" -foregroundcolor DarkYellow
- ps: write-host "Revision = $revision" -foregroundcolor Cyan
- ps: write-host "Build suffix = $env:BUILD_SUFFIX" -foregroundcolor Yellow
- ps: write-host "Version suffix = $env:VERSION_SUFFIX" -foregroundcolor Red
- ps: dotnet --version
build_script:
- ps: dotnet build src\redmine-net-api\redmine-net-api.csproj -c Release --version-suffix=$env:BUILD_SUFFIX
- ps: dotnet build src\redmine-net-api\redmine-net-api.csproj -c Release --version-suffix=$env:BUILD_SUFFIX -p:Sign=true
after_build:
- ps: dotnet pack src\redmine-net-api\redmine-net-api.csproj -c Release --output .\artifacts --include-symbols -p:SymbolPackageFormat=snupkg --no-build $env:VERSION_SUFFIX
- ps: dotnet pack src\redmine-net-api\redmine-net-api.csproj -c Release --output .\artifacts --include-symbols -p:SymbolPackageFormat=snupkg --no-build $env:VERSION_SUFFIX -p:Sign=true
test: off
artifacts:
- name: NuGet Packages
path: .\artifacts\**\*.nupkg
- name: NuGet Symbol Packages
path: .\artifacts\**\*.snupkg
skip_commits:
files:
- '**/*.md'
- '**/*.gif'
- '**/*.png'
- LICENSE
- tests/*
for:
-
matrix:
only:
- image: Ubuntu
deploy:
- provider: NuGet
name: production
api_key:
secure: W38N2nYNrxoik84zDowE+ShuVYKUyPA/fl4/8nYMBEXwcG+pSHVkt/2r6xQvQOaC
skip_symbols: true
on:
APPVEYOR_REPO_TAG: true