-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathappveyor.yml
129 lines (115 loc) · 4.93 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
119
120
121
122
123
124
125
126
127
128
129
version: "{build}-ci"
branches:
except:
- gh-pages
environment:
VersionMajor: 0
VersionMinor: 1
VersionPatch: 0
SandCastleZipFile: C:\projects\stardew-tools\SHFBInstaller.zip
SandCastleUri: https://github.com/EWSoftware/SHFB/releases/download/v2015.10.10.0/SHFBInstaller_v2015.10.10.0.zip
XnaFile: C:\projects\stardew-tools\xnafx40_redist.msi
XnaUri: https://download.microsoft.com/download/A/C/2/AC2C903B-E6E8-42C2-9FD7-BEBAC362A930/xnafx40_redist.msi
SHFBROOT: C:\Program Files (x86)\EWSoftware\Sandcastle Help File Builder\
TOOL_USER:
secure: OHqX4MUJkciXyaPO+OpTSg==
TOOL_TOKEN:
secure: DyhBy87Gg91K1KVM6kkOLIQ9ake6Xx/eX6UVbw/+Cxw=
image: Visual Studio 2015
clone_folder: c:\projects\stardew-farmhand
shallow_clone: false
clone_depth: 5
configuration:
- Release
init:
- ps: |
$env:BuildDir = "$env:APPVEYOR_BUILD_FOLDER\.OUTPUT"
$env:VersionBuild = "$env:APPVEYOR_BUILD_NUMBER"
$env:VersionStage = "$env:APPVEYOR_REPO_BRANCH"
$env:VersionTag = "$env:APPVEYOR_REPO_COMMIT"
install:
- cmd: git submodule update --init --recursive
- cmd: mkdir "C:\projects\stardew-tools\"
- ps: Start-FileDownload $env:SandCastleUri -FileName $env:SandCastleZipFile
- ps: Start-FileDownload $env:XnaUri -FileName $env:XnaFile
- cmd: 7z x C:\projects\stardew-tools\SHFBInstaller.zip -oC:\projects\stardew-tools -y
- ps: msiexec /i C:\projects\stardew-tools\InstallResources\SandcastleHelpFileBuilder.msi /quiet /norestart /log install.log
- ps: msiexec /i $env:XnaFile /quiet /norestart /log xnainstall.log
before_build:
- cmd: '"C:\Program Files\Git\cmd\git.exe" clone "https://%TOOL_USER%:%TOOL_TOKEN%@gitlab.com/ClxS/Tool.git" "C:\projects\stardew-farmhand\Staging"'
build_script:
- ps: |
nuget restore
$buildCmd = "C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe"
$buildArgs = @(
"/m",
"/l:C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll",
'/p:Platform="Windows"',
"/p:Configuration=$env:CONFIGURATION",
"/p:DefineConstants=WINDOWS"
"/v:m")
# If build is not a scheduled one, than simply build project with MSBuild.
if ($env:APPVEYOR_SCHEDULED_BUILD -ne "True") {
Write-Host "Compiling Windows"
& $buildCmd $buildArgs
# If we're on the release branch and a tag was just pushed
if ($env:APPVEYOR_REPO_TAG -eq "True") {
# Build documentation
Write-Host "Compiling Documentation"
$buildArgs = @(
"/m",
"/t:Documentation\Farmhand"
"/l:C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll",
"/p:Platform=Documentation",
"/p:Configuration=$env:CONFIGURATION",
"/p:DefineConstants=WINDOWS"
"/v:m")
& $buildCmd $buildArgs
# Build the installer
Write-Host "Compiling Installer"
$buildArgs = @(
"/m",
"/l:C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll",
"/p:Platform=Installer",
"/p:Configuration=Release",
"/p:DefineConstants=WINDOWS"
"/v:m")
& $buildCmd $buildArgs
git clone https://github.com/ClxS/Stardew-Farmhand.git C:\projects\stardew-docs
Set-Location -Path C:\projects\stardew-docs
git checkout gh-pages
Remove-Item "C:\projects\stardew-docs\api-reference\" -Recurse -ErrorAction Ignore
robocopy "C:\projects\stardew-farmhand\Documentation\Farmhand\Help" "C:\projects\stardew-docs\api-reference" *.* /NFL /NDL /NJH /NJS /nc /ns /np /E
git config --global core.safecrlf false
git add -A
git commit -m "Updated documentation to $env:APPVEYOR_REPO_COMMIT"
git push https://ClxS:$env:PushToken@github.com/ClxS/Stardew-Farmhand.git -f
Set-Location -Path C:\projects\stardew-farmhand
}
}
- ps: |
if ($env:APPVEYOR_SCHEDULED_BUILD -ne "True") {
return
}
nuget install PublishCoverity -Version 0.10.0
# Else, build project with Coverity Scan.
"Building project with Coverity..."
& "cov-build.exe" `
--dir cov-int `
$buildCmd $buildArgs
$version = "$env:VersionMajor.$env:VersionMinor.$env:VersionPatch" +
"-$env:VersionStage+$env:VersionBuild"
$formField = New-Object Net.Http.StringContent($version)
# Compress results.
PublishCoverity.0.10.0/PublishCoverity compress -o "$env:APPVEYOR_BUILD_FOLDER\$env:APPVEYOR_PROJECT_NAME.zip" -i "$env:APPVEYOR_BUILD_FOLDER\cov-int"
PublishCoverity.0.10.0/PublishCoverity publish -z "$env:APPVEYOR_BUILD_FOLDER\$env:APPVEYOR_PROJECT_NAME.zip" -r ClxS/Stardew-Farmhand -t $env:CoverityProjectToken -e $env:CoverityNotificationEmail -d "Scheduled CI server build." --codeVersion "$formField"
artifacts:
- path: Bin\Windows\Release\FarmhandInstaller.exe
name: FarmhandInstaller
deploy:
- provider: GitHub
artifact: FarmhandInstaller
auth_token:
secure: 71Fs8tgv3qdm67kFg+R4TM/dwoLJdEbZf8cVX+4Rg4HJ1fBnHgh30KQ8Sp0b7sm8
on:
APPVEYOR_REPO_TAG: true