-
Notifications
You must be signed in to change notification settings - Fork 34
/
appveyor.yml
72 lines (72 loc) · 2.53 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
version: 1.1.{build}
image:
- Visual Studio 2022
- Ubuntu1604
skip_commits:
files:
- '*.md'
- '*.txt'
- '.git*'
configuration: Release
init:
- cmd: git config --global core.autocrlf true
install:
- cmd: curl -OsSL https://dot.net/v1/dotnet-install.ps1
- ps: |
if ($isWindows) {
./dotnet-install.ps1 -JsonFile global.json
./dotnet-install.ps1 -Runtime dotnet -Version 6.0.12 -SkipNonVersionedFiles
}
- sh: |
curl -OsSL https://dot.net/v1/dotnet-install.sh
chmod +x dotnet-install.sh
./dotnet-install.sh --jsonfile global.json
./dotnet-install.sh --runtime dotnet --version 6.0.12 --skip-non-versioned-files
export PATH="$HOME/.dotnet:$PATH"
before_build:
- dotnet --info
- dotnet tool restore
build_script:
- ps: |
dotnet build --configuration $env:CONFIGURATION
if ($isWindows) {
$versionSuffix = ([datetimeoffset]$env:APPVEYOR_REPO_COMMIT_TIMESTAMP).ToUniversalTime().ToString('yyyyMMdd''t''HHmm')
$releaseNotesFile = [System.IO.Path]::GetTempFileName()
$tag = $env:APPVEYOR_REPO_TAG_NAME
# if the tag starts with "v", as in "v1.0.0", assume it's a release
if ($tag -clike 'v*') {
$url = (git remote get-url (git remote)) -replace '\.git$', ''
if ($LASTEXITCODE) { throw; }
Add-Content $releaseNotesFile -Encoding UTF8 "See: ${url}/releases/tag/$tag"
Add-Content $releaseNotesFile -Encoding UTF8 ''
# if tag ends in "-" followed by dot-separated identifiers...
if ($tag -match '(?<=-)[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*$') {
$versionSuffix = $matches[0] # ...then use as suffix for pre-release
} else {
$versionSuffix = $null # ... else use no suffix for a release
}
}
Add-Content $releaseNotesFile -Encoding UTF8 "Commit @ $(git rev-parse HEAD)"
$packArgs = @()
if ($versionSuffix) {
$packArgs += @('--version-suffix', $versionSuffix)
}
dotnet pack --no-build --configuration $env:CONFIGURATION @packArgs "-p:PackageReleaseNotesFile=$releaseNotesFile"
if ($LASTEXITCODE) { throw; }
Get-ChildItem -File -Filter docopt.net.*.nupkg dist |
Select-Object -ExpandProperty FullName |
% { dotnet sourcelink test $_; if ($LASTEXITCODE) { throw; } }
}
test_script:
- ps: dotnet test --no-build
- pwsh: |
if ($isWindows) {
./tests/Integration/run.ps1 -NoPack # already packed on Windows build
} else {
./tests/Integration/run.ps1
}
after_test:
- sh: rm -rf dist/*.nupkg
artifacts:
- path: 'dist\*.nupkg'
name: NuGet