This repository has been archived by the owner on Apr 28, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 87
/
appveyor.yml
72 lines (67 loc) · 2.97 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: '{build}'
pull_requests:
do_not_increment_build_number: true
image: WMF 5
init:
- ps: Install-PackageProvider NuGet -Force
- ps: (new-object net.webclient).DownloadFile('https://dotnetcli.blob.core.windows.net/dotnet/Sdk/rel-1.0.0/dotnet-dev-win-x64.latest.exe', "c:/dotnet-install.exe")
- cmd: c:\dotnet-install.exe /install /quiet
install:
- ps: Install-Module platyPS -Force -RequiredVersion 0.7.0
- cmd: git submodule update --init --recursive
nuget:
disable_publish_on_pr: true
build_script:
- ps: $psversiontable
- ps: dotnet --version
- ps: get-packageprovider nuget
- ps: ipmo platyPS -Version 0.7.0 ; get-module -name platyPS
- ps: |
$env:PATH = "c:\program files\dotnet;$env:PATH"
$projectFile = "src\Docker.PowerShell\project.json"
$project = Get-Content $projectFile -Raw | ConvertFrom-Json
$version = $project.version
# Tags do not get build versions.
if ($env:APPVEYOR_REPO_TAG -ne "true") {
$version += ".$($env:APPVEYOR_BUILD_VERSION.split("-")[0])"
# Update the project.json version to include the build number.
$project.version = $version
ConvertTo-Json $project -Depth 100 | Out-File -Encoding UTF8 $projectFile
}
# Replace module manifest version.
$manifest = "src\Docker.PowerShell\Docker.psd1"
(Get-Content $manifest -Raw) -replace "ModuleVersion.+","ModuleVersion = '$version'" | Out-File $manifest
Get-Content $projectFile
Get-Content $manifest
- ps: dotnet restore
- ps: dotnet build src/Docker.PowerShell/project.json
- ps: dotnet publish -f net46 -o $pwd\bin\Docker\clr -c Release $pwd\src\Docker.PowerShell
- ps: dotnet publish -f netstandard1.6 -o $pwd\bin\Docker\coreclr -c Release $pwd\src\Docker.PowerShell
- ps: nuget install Newtonsoft.Json -Version 9.0.1 -OutputDirectory $pwd\bin
- ps: cp $pwd\bin\Docker\coreclr\Docker.*ps* $pwd\bin\Docker\
- ps: cp $pwd\bin\Newtonsoft.Json.9.0.1\lib\portable-net45+wp80+win8+wpa81\Newtonsoft.Json.dll $pwd\bin\Docker\coreclr\Newtonsoft.Json.dll
- ps: New-ExternalHelp -Path src\Docker.PowerShell\Help -OutputPath $pwd\bin\Docker\en-US
- ps: mkdir $pwd\testRepo
- ps: Register-PSRepository -Name test -SourceLocation $pwd\testRepo
- ps: Publish-Module -Path $pwd\bin\Docker -Repository test
test_script:
- ps: Install-Module -Name Docker -Repository test -Force
- ps: Import-Module Docker
- ps: |
if (!(gcm -Module Docker)){
throw "Module failed to load: no commands found."
}
- ps: git checkout -- src/Docker.PowerShell/Docker.psd1
- ps: git checkout -- src/Docker.PowerShell/project.json
- ps: git config core.autocrlf true
- ps: New-MarkdownHelp -Module Docker -OutputFolder src\Docker.PowerShell\Help -ErrorAction SilentlyContinue
- ps: Update-MarkdownHelp -Path src\Docker.PowerShell\Help
- ps: |
git add src\Docker.PowerShell\Help\.
git status -s
git diff
if ((git status -s)){
throw "Help files do not match updated cmdlets. Please update the help markdown to correspond to the latest changes."
}
artifacts:
- path: testRepo/*.nupkg