forked from OrchardCMS/OrchardCore
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathappveyor.yml
68 lines (62 loc) · 3.13 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
image: Visual Studio 2017
environment:
nodejs_version: "6.9.1"
global:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
DOTNET_CLI_TELEMETRY_OPTOUT: 1
DOCKER_USER:
secure: 2a9QfyDw5J1NDZD80kMwhQ==
DOCKER_PASS:
secure: aLjaywnziVFcRa3uZ8iMteFDjA1wp0fSaPMaBE55LO4=
MYGET_API_KEY:
secure: 8Fp2ETunhU6PvhlotuQXTZ7WkG1FikJ3BM7YLAZyfmbpy00knABu5yL7MhJ9uNcl
NUGET_API_KEY:
secure: bR0JuO8NuLOxL18tQ7ZtQXOHNHjqCJXlkUOzEyNQniptTszwYcwufYhKTyoybqei
# Install scripts. (runs after repo cloning)
install:
# Download .NET Core 2.0 SDK and add to PATH
- ps: $urlCurrent = "https://dotnetcli.azureedge.net/dotnet/Sdk/2.1.4/dotnet-sdk-2.1.4-win-x64.zip"
- ps: $env:DOTNET_INSTALL_DIR = "$pwd\.dotnetsdk"
- ps: mkdir $env:DOTNET_INSTALL_DIR -Force | Out-Null
- ps: $tempFileCurrent = [System.IO.Path]::GetTempFileName()
- ps: (New-Object System.Net.WebClient).DownloadFile($urlCurrent, $tempFileCurrent)
- ps: Add-Type -AssemblyName System.IO.Compression.FileSystem; [System.IO.Compression.ZipFile]::ExtractToDirectory($tempFileCurrent, $env:DOTNET_INSTALL_DIR)
- ps: $env:Path = "$env:DOTNET_INSTALL_DIR;$env:Path"
# Get the latest stable version of Node.js or io.js
- ps: Install-Product node $env:nodejs_version
- ps: $env:BuildNumber= $env:APPVEYOR_BUILD_NUMBER
- ps: $IsMasterBranch = ($env:APPVEYOR_REPO_BRANCH -eq "master" -And -not $env:APPVEYOR_PULL_REQUEST_NUMBER)
- ps: $IsDevBranch = ($env:APPVEYOR_REPO_BRANCH -eq "dev" -And -not $env:APPVEYOR_PULL_REQUEST_NUMBER)
init:
- git config --global core.autocrlf true
build_script:
- dotnet --version
- ps: if (($IsMasterBranch -eq $true) -or ($IsDevBranch -eq $true)) { dotnet pack -c Release }
- ps: |
if ($IsMasterBranch -eq $true)
{
cd $env:APPVEYOR_BUILD_FOLDER\src\OrchardCore.Cms.Web
dotnet publish -c Release -o $env:APPVEYOR_BUILD_FOLDER\.build\release
cd $env:APPVEYOR_BUILD_FOLDER
docker build -t orchardproject/orchardcore-cms-windows:latest -t orchardproject/orchardcore-cms-windows:1.0.0-beta2 .
docker login -u="$env:DOCKER_USER" -p="$env:DOCKER_PASS"
docker push orchardproject/orchardcore-cms-windows
}
if ($IsDevBranch -eq $true)
{
cd $env:APPVEYOR_BUILD_FOLDER\src\OrchardCore.Cms.Web
dotnet publish -c Release -o $env:APPVEYOR_BUILD_FOLDER\.build\release
cd $env:APPVEYOR_BUILD_FOLDER
docker build -t orchardproject/orchardcore-cms-windows:dev .
docker login -u="$env:DOCKER_USER" -p="$env:DOCKER_PASS"
docker push orchardproject/orchardcore-cms-windows
}
test_script:
- dotnet test -c Release .\test\OrchardCore.Tests\OrchardCore.Tests.csproj
clone_depth: 1
test: on
artifacts:
- path: 'src\**\*.nupkg'
deploy_script:
- ps: if ($IsMasterBranch -eq $true) { foreach ($artifactName in $artifacts.keys) { nuget push $artifacts[$artifactName].path $env:NUGET_API_KEY -Source https://www.nuget.org/api/v2/package } }
- ps: if ($IsDevBranch -eq $true) { foreach ($artifactName in $artifacts.keys) { nuget push $artifacts[$artifactName].path $env:MYGET_API_KEY -Source https://www.myget.org/F/orchardcore-preview/api/v2/package } }