-
Notifications
You must be signed in to change notification settings - Fork 46
/
appveyor.yml
63 lines (57 loc) · 2.54 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
version: 3.1.0-dev.{build}
pull_requests:
do_not_increment_build_number: true
skip_branch_with_pr: true
image: Visual Studio 2022
configuration: Release
init:
- dotnet --list-sdks
- ps: |
$VerbosePreference = "continue"
Invoke-WebRequest -Uri 'https://dot.net/v1/dotnet-install.ps1' -UseBasicParsing -OutFile "$env:temp\dotnet-install.ps1"
& $env:temp\dotnet-install.ps1 -Architecture x64 -Channel 5.0 -InstallDir "$env:ProgramFiles\dotnet"
- ps: |
git config --global core.autocrlf true
Write-Host "Original Appveyor build version: $env:APPVEYOR_BUILD_VERSION"
$env:PACKAGE_VERSION = $env:APPVEYOR_BUILD_VERSION
$appveyor_build_version = $env:APPVEYOR_BUILD_VERSION
$env:GIT_HASH=$env:APPVEYOR_REPO_COMMIT.Substring(0, 10)
Write-Host "Git commit hash: $env:GIT_HASH"
If ($env:APPVEYOR_REPO_TAG -and ($env:APPVEYOR_REPO_TAG_NAME -match "^v(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$"))
{
$env:PACKAGE_VERSION=$env:APPVEYOR_REPO_TAG_NAME.Substring(1)
$appveyor_build_version="$env:PACKAGE_VERSION ($env:APPVEYOR_BUILD_NUMBER)"
Write-Host "Tagged version: $env:PACKAGE_VERSION"
Write-Host "New build version: $appveyor_build_version"
}
$version_split_at_hyphen = $env:PACKAGE_VERSION -split '-'
$major_minor_patch = $version_split_at_hyphen[0]
$major_minor_patch_split = $major_minor_patch -split '\.'
$major = $major_minor_patch_split[0]
$env:ASSEMBLY_VERSION = "$major.0.0.0"
$env:FILE_VERSION = "$major_minor_patch.0"
$env:INFORMATIONAL_Version = "$env:PACKAGE_VERSION+$env:GIT_HASH"
Write-Host "Computed package version: $env:PACKAGE_VERSION"
Write-Host "Computed assembly version: $env:ASSEMBLY_VERSION"
Write-Host "Computed file version: $env:FILE_VERSION"
Write-Host "Computed info version: $env:INFORMATIONAL_Version"
Update-AppveyorBuild -Version "$appveyor_build_version"
dotnet_csproj:
patch: true
file: '**\Semver.csproj'
version: '$(PACKAGE_VERSION)'
package_version: '$(PACKAGE_VERSION)'
assembly_version: '$(ASSEMBLY_VERSION)'
file_version: '$(FILE_VERSION)'
informational_version: "$(INFORMATIONAL_Version)"
before_build:
- dotnet restore
build:
verbosity: minimal
publish_nuget: true
publish_nuget_symbols: true
use_snupkg_format: true
# Test Discovery was running both xUnit and dotnet test.
# To prevent that, use a test script to run dotnet test.
test_script:
- dotnet test "Semver.Test"