forked from OrchardCMS/OrchardCore
-
Notifications
You must be signed in to change notification settings - Fork 0
/
appveyor.yml
118 lines (104 loc) · 3.76 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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
image: Visual Studio 2019
# Do not build feature branch with open Pull Requests
skip_branch_with_pr: true
branches:
only:
- master
- dev
# Do not build if there are only documentation changes
skip_commits:
files:
- '**/*.md'
- mkdocs.yml
- src/docs/**/*
environment:
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
stack: node 9, docker
# build cache to preserve files/folders between builds
cache:
- node_modules -> **\package.json # local npm modules
- '%LocalAppData%\NuGet\v3-cache -> **\*.props' # NuGet v3
# Install scripts. (runs after repo cloning)
install:
- 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)
# Uncomment to download a specific version of dotnet
# - ps: Invoke-WebRequest "https://raw.githubusercontent.com/dotnet/cli/master/scripts/obtain/dotnet-install.ps1" -OutFile "dotnet-install.ps1"
# - ps: .\dotnet-install.ps1 --Version 3.1.101
build_script:
- dotnet build -c Release
- ps: if ($IsMasterBranch -or $IsDevBranch) { dotnet pack -c Release --no-build }
init:
- dotnet --version
- node --version
- npm --version
- git config --global core.autocrlf true
test_script:
- dotnet test -c Release --no-build .\test\OrchardCore.Tests\OrchardCore.Tests.csproj
- cd .\test\Functional
- test-setup.cmd
- test-run.cmd
clone_depth: 1
test: on
artifacts:
- path: 'src\**\*.nupkg'
deploy:
- provider: NuGet
on:
branch: dev
server: https://www.myget.org/F/orchardcore-preview/api/v2/package
api_key:
secure: 8Fp2ETunhU6PvhlotuQXTZ7WkG1FikJ3BM7YLAZyfmbpy00knABu5yL7MhJ9uNcl
skip_symbols: true
artifact: /.*\.nupkg/
- provider: NuGet
on:
branch: dev
server: https://nuget.pkg.github.com/OrchardCMS/index.json
username: sebastienros
api_key:
secure: AJx82moR9XibIs1lxvDToOle/7BqC+XX6ztrJ6CMSU+85/dqM3dvHUdf0LVymAzV
skip_symbols: true
artifact: /.*\.nupkg/
- provider: NuGet
on:
branch: master
server: https://www.nuget.org/api/v2/package
api_key:
secure: bR0JuO8NuLOxL18tQ7ZtQXOHNHjqCJXlkUOzEyNQniptTszwYcwufYhKTyoybqei
skip_symbols: true
artifact: /.*\.nupkg/
# DockerHub
after_deploy:
- ps: |
if ($IsMasterBranch)
{
cd $env:APPVEYOR_BUILD_FOLDER\src\OrchardCore.Cms.Web
Get-ChildItem -path ".\App_Data\" | Remove-Item -Recurse -Confirm:$false -Force
dotnet publish -c Release --no-build -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-rc1 .
echo "$env:DOCKER_PASS" | docker login -u="$env:DOCKER_USER" --password-stdin
docker push orchardproject/orchardcore-cms-windows
}
if ($IsDevBranch)
{
cd $env:APPVEYOR_BUILD_FOLDER\src\OrchardCore.Cms.Web
Get-ChildItem -path ".\App_Data\" | Remove-Item -Recurse -Confirm:$false -Force
dotnet publish -c Release --no-build -o $env:APPVEYOR_BUILD_FOLDER\.build\release
cd $env:APPVEYOR_BUILD_FOLDER
docker build -t orchardproject/orchardcore-cms-windows:dev .
echo "$env:DOCKER_PASS" | docker login -u="$env:DOCKER_USER" --password-stdin
docker push orchardproject/orchardcore-cms-windows
}