|
1 | 1 | # Copyright (c) 2018 The nanoFramework project contributors |
2 | 2 | # See LICENSE file in the project root for full license information. |
3 | 3 |
|
4 | | -# skip updating dependencies if build is a pull-request or not a tag |
5 | | -if ($env:appveyor_pull_request_number -or $env:APPVEYOR_REPO_TAG -eq 'false') |
| 4 | +# skip updating dependencies if build is a pull-request or not a tag (master OR release) |
| 5 | +if ($env:appveyor_pull_request_number -or |
| 6 | + ($env:APPVEYOR_REPO_BRANCH -eq "master" -and $env:APPVEYOR_REPO_TAG -eq 'false') -or |
| 7 | + ($env:APPVEYOR_REPO_BRANCH -match "^release*" -and $env:APPVEYOR_REPO_TAG -eq 'false') -or |
| 8 | + $env:APPVEYOR_REPO_TAG -eq "false") |
6 | 9 | { |
7 | 10 | 'Skip updating dependencies...' | Write-Host -ForegroundColor White |
8 | 11 | } |
|
46 | 49 | $solutionFile = (Get-ChildItem -Path ".\" -Include "*.sln" -Recurse) |
47 | 50 |
|
48 | 51 | # run NuKeeper inspect |
49 | | - if ($env:APPVEYOR_REPO_BRANCH -like '*release*' -or $env:APPVEYOR_REPO_BRANCH-like '*master*') |
50 | | - { |
51 | | - # use NuGet ONLY for release and master branches |
52 | | - $nukeeperInspect = NuKeeper inspect --source https://api.nuget.org/v3/index.json |
53 | | - } |
54 | | - else |
55 | | - { |
56 | | - # use NuGet and MyGet for all others |
57 | | - $nukeeperInspect = NuKeeper inspect |
58 | | - } |
| 52 | + $nukeeperInspect = NuKeeper inspect |
59 | 53 |
|
60 | 54 | "NuGet update inspection result:" | Write-Host -ForegroundColor Cyan |
61 | 55 | $nukeeperInspect | Write-Host -ForegroundColor White |
|
71 | 65 | [array]$packageList = $packageListRaw.Split([Environment]::NewLine, [StringSplitOptions]::RemoveEmptyEntries).Replace([Environment]::NewLine, "") |
72 | 66 |
|
73 | 67 | # restore NuGet packages, need to do this before anything else |
74 | | - if ($env:APPVEYOR_REPO_BRANCH -like '*release*' -or $env:APPVEYOR_REPO_BRANCH -like '*master*') |
75 | | - { |
76 | | - # use NuGet ONLY for release and master branches |
77 | | - nuget restore $solutionFile[0] -Source https://api.nuget.org/v3/index.json |
78 | | - } |
79 | | - else |
80 | | - { |
81 | | - # use NuGet and MyGet for all others |
82 | | - nuget restore $solutionFile[0] -Source https://www.myget.org/F/nanoframework-dev/api/v3/index.json -Source https://api.nuget.org/v3/index.json |
83 | | - } |
| 68 | + nuget restore $solutionFile[0] -Source https://www.myget.org/F/nanoframework-dev/api/v3/index.json -Source https://api.nuget.org/v3/index.json |
84 | 69 |
|
85 | 70 | # rename nfproj files to csproj |
86 | 71 | Get-ChildItem -Path ".\" -Include "*.nfproj" -Recurse | |
|
100 | 85 | $packageTargetVersion = $packageDetails.captures.Groups[6].Value.Trim(); |
101 | 86 |
|
102 | 87 | # update package |
103 | | - if ($env:APPVEYOR_REPO_BRANCH -like '*release*' -or $env:APPVEYOR_REPO_BRANCH -like '*master*') |
104 | | - { |
105 | | - # use NuGet ONLY for release and master branches |
106 | | - $updatePackage = nuget update $solutionFile[0].FullName -Source https://api.nuget.org/v3/index.json |
107 | | - } |
108 | | - else |
109 | | - { |
110 | | - # use NuGet and MyGet for all others |
111 | | - $updatePackage = nuget update $solutionFile[0].FullName -Source https://www.myget.org/F/nanoframework-dev/api/v3/index.json -Source https://api.nuget.org/v3/index.json |
112 | | - } |
| 88 | + $updatePackage = nuget update $solutionFile[0].FullName -Source https://www.myget.org/F/nanoframework-dev/api/v3/index.json -Source https://api.nuget.org/v3/index.json |
113 | 89 |
|
114 | 90 | # grab csproj from update output |
115 | 91 | $projectPath = [regex]::Match($updatePackage, "((project ')(.*)(', targeting))").captures.Groups[3].Value |
|
0 commit comments