Skip to content

Commit 7cd243f

Browse files
committed
Update appveyor build scripts
1 parent 264087f commit 7cd243f

File tree

1 file changed

+16
-17
lines changed

1 file changed

+16
-17
lines changed

.appveyor.yml

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -20,21 +20,6 @@ branches:
2020

2121
clone_depth: 1
2222

23-
init:
24-
- ps: |
25-
If ($Env:APPVEYOR_REPO_TAG_NAME -match "-"){
26-
$headers = @{
27-
"Authorization" = "Bearer $env:GITHUB_TOKEN"
28-
"Content-type" = "application/json"
29-
}
30-
$releases = Invoke-RestMethod -Uri "https://api.github.com/repos/$env:APPVEYOR_REPO_NAME/releases" -Headers $headers -Method GET
31-
$env:releaseDescription = ($releases | Where-Object {$_.name -eq "$env:APPVEYOR_REPO_TAG_NAME"}).body
32-
Set-AppveyorBuildVariable -Name "IsPreRelease" -Value True
33-
}
34-
Else{
35-
Set-AppveyorBuildVariable -Name "IsPreRelease" -Value False
36-
}
37-
3823
environment:
3924
global:
4025
# Set the DOTNET_SKIP_FIRST_TIME_EXPERIENCE environment variable to stop wasting time caching packages
@@ -57,9 +42,23 @@ nuget:
5742
# Do not publish NuGet packages for pull requests
5843
disable_publish_on_pr: true
5944

45+
6046
init:
61-
# Good practise, because Windows line endings are different from Unix/Linux ones
62-
- cmd: git config --global core.autocrlf true
47+
- ps: |
48+
If ($Env:APPVEYOR_REPO_TAG_NAME -match "-"){
49+
$headers = @{
50+
"Authorization" = "Bearer $env:GITHUB_TOKEN"
51+
"Content-type" = "application/json"
52+
}
53+
$releases = Invoke-RestMethod -Uri "https://api.github.com/repos/$env:APPVEYOR_REPO_NAME/releases" -Headers $headers -Method GET
54+
$env:releaseDescription = ($releases | Where-Object {$_.name -eq "$env:APPVEYOR_REPO_TAG_NAME"}).body
55+
Set-AppveyorBuildVariable -Name "IsPreRelease" -Value True
56+
}
57+
Else{
58+
Set-AppveyorBuildVariable -Name "IsPreRelease" -Value False
59+
}
60+
# Good practise, because Windows line endings are different from Unix/Linux ones
61+
- cmd: git config --global core.autocrlf true
6362

6463
install:
6564
# .NET Core SDK binaries

0 commit comments

Comments
 (0)