forked from luigiberrettini/NLog.Targets.Syslog
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathappveyor.yml
44 lines (44 loc) · 2.23 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
version: BUILD {build}
image: Visual Studio 2017
skip_branch_with_pr: true
environment:
NUGET_API_KEY:
secure: w4DT+CkuVfttvjO4tkpTtiD8kRWvu4Jgf9YTIWIEQ/ebVLLF1lbz/JyeigqirQQt
install:
- ps: |
$DOTNET_INSTALL_DIR = $(Join-Path (Get-Location) 'dotnetsdk')
$dotnetReleasesUrl = 'https://dotnetcli.blob.core.windows.net/dotnet/release-metadata/releases-index.json'
$dotnetReleases = $(Invoke-WebRequest $dotnetReleasesUrl | ConvertFrom-Json)."releases-index"
function Install-LatestDotNetSdk($Channel) {
$version = ($dotnetReleases | Where-Object { $_.'channel-version' -eq $channel }).'latest-sdk'
powershell -NoProfile -ExecutionPolicy Unrestricted -Command "&([scriptblock]::Create((Invoke-WebRequest -UseBasicParsing 'https://dot.net/v1/dotnet-install.ps1'))) -Version $version -InstallDir $DOTNET_INSTALL_DIR -NoPath"
}
Install-LatestDotNetSdk -Channel '1.1'
Install-LatestDotNetSdk -Channel '2.1'
Install-LatestDotNetSdk -Channel '2.2'
$env:Path = "$DOTNET_INSTALL_DIR;$env:Path"
before_build:
- ps: |
$mostRecentTag = git describe --abbrev=0 --tags --always
if ($mostRecentTag.Substring(0, 1) -ne 'v') {
$mostRecentTag = 'v1.0.0'
if ($env:APPVEYOR_REPO_TAG -eq 'true') { exit 1 }
}
$mostRecentVersion = $mostRecentTag.Substring(1)
$currentCommitHash = git rev-parse --short HEAD
Set-AppveyorBuildVariable -Name SW_VER -Value $mostRecentVersion
Update-AppveyorBuild -Version "Build $env:APPVEYOR_BUILD_NUMBER - Commit $currentCommitHash - Tag v$mostRecentVersion"
build_script:
- ps: |
if ($env:APPVEYOR_REPO_TAG -ne 'true') {
.\build\scripts\bootstrap.ps1 '--target=NuGetPack' "--softwareVersion=$env:SW_VER" "--buildNumber=$env:APPVEYOR_BUILD_NUMBER"
}
else {
.\build\scripts\bootstrap.ps1 '--target=NuGetPush' "--softwareVersion=$env:SW_VER" '--nuGetSource=https://api.nuget.org/v3/index.json' "--nuGetApiKey=$env:NUGET_API_KEY"
}
if ($LastExitCode -ne 0) { exit $LastExitCode }
after_build:
- ps: |
.\build\scripts\bootstrap.ps1 '--target=ZipArtifacts'
Push-AppveyorArtifact .\build\artifacts\artifacts.zip -FileName "artifacts_$env:APPVEYOR_BUILD_ID.zip"
test: off