Skip to content
This repository was archived by the owner on Jun 21, 2023. It is now read-only.

Commit 467d5b2

Browse files
authored
Merge pull request #2213 from github/build/vsinstaller
Enabling VS Installer packages in CI
2 parents 625e502 + f714892 commit 467d5b2

File tree

3 files changed

+45
-17
lines changed

3 files changed

+45
-17
lines changed

appveyor.yml

Lines changed: 35 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,27 @@
11
os: Visual Studio 2017
22
version: '2.8.0.{build}'
33
skip_tags: true
4+
5+
environment:
6+
matrix:
7+
- BUILD_TYPE: normal
8+
49
install:
10+
- choco install --no-progress BCC-MSBuildLog
11+
- choco install --no-progress BCC-Submission
512
- ps: |
613
$full_build = Test-Path env:GHFVS_KEY
14+
$forVSInstaller = $env:BUILD_TYPE -eq "vsinstaller"
15+
$package = $full_build -and ($env:APPVEYOR_PULL_REQUEST_NUMBER -or $env:APPVEYOR_REPO_BRANCH -eq "master" -or $forVSInstaller -or $env:BUILD_TYPE -eq "package")
16+
17+
$message = "Building "
18+
if ($package) { $message += "and packaging "}
19+
$message += "version " + $env:APPVEYOR_BUILD_NUMBER + " "
20+
21+
if ($full_build) { $message += "(full build)" } else { $message += "(partial build)" }
22+
if ($forVSInstaller) { $message += " for the VS installer" }
23+
Write-Host $message
24+
725
git submodule init
826
git submodule sync
927
@@ -18,19 +36,28 @@ install:
1836
1937
git submodule update --recursive --force
2038
nuget restore GitHubVS.sln
21-
- choco install --no-progress BCC-MSBuildLog
22-
- choco install --no-progress BCC-Submission
39+
2340
build_script:
24-
- ps: scripts\build.ps1 -AppVeyor -BuildNumber:$env:APPVEYOR_BUILD_NUMBER
41+
- ps: scripts\build.ps1 -AppVeyor -Package:$package -BuildNumber:$env:APPVEYOR_BUILD_NUMBER -ForVSInstaller:$forVSInstaller
42+
2543
test:
2644
categories:
2745
except:
2846
- Timings
47+
2948
on_success:
3049
- ps: |
31-
if ($full_build) {
32-
script\Sign-Package -AppVeyor
50+
if ($package) {
51+
Write-Host "Signing and packaging"
52+
script\Sign-Package -AppVeyor -ForVSInstaller:$forVSInstaller
3353
}
34-
on_finish:
35-
- IF NOT "%BCC_TOKEN%x"=="x" BCCMSBuildLog --cloneRoot "%APPVEYOR_BUILD_FOLDER%" --input output.binlog --output checkrun.json --ownerRepo %APPVEYOR_REPO_NAME% --hash %APPVEYOR_REPO_COMMIT%
36-
- IF NOT "%BCC_TOKEN%x"=="x" BCCSubmission -h %APPVEYOR_REPO_COMMIT% -i checkrun.json -t %BCC_TOKEN%
54+
55+
for:
56+
-
57+
branches:
58+
only:
59+
- /releases/.*-vsinstaller/
60+
environment:
61+
matrix:
62+
- BUILD_TYPE: vsinstaller
63+
- BUILD_TYPE: package

scripts/build.ps1

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ Param(
3838
,
3939
[switch]
4040
$Trace = $false
41+
,
42+
[switch]
43+
$ForVSInstaller = $false
44+
4145
)
4246

4347
Set-StrictMode -Version Latest
@@ -53,6 +57,10 @@ Vsix | out-null
5357

5458
Push-Location $rootDirectory
5559

60+
if ($Package -and $BuildNumber -gt -1) {
61+
$BumpVersion = $true
62+
}
63+
5664
if ($UpdateSubmodules) {
5765
Update-Submodules
5866
}
@@ -61,13 +69,6 @@ if ($Clean) {
6169
Clean-WorkingTree
6270
}
6371

64-
$fullBuild = Test-Path env:GHFVS_KEY
65-
$publishable = $fullBuild -and $AppVeyor -and ($env:APPVEYOR_PULL_REQUEST_NUMBER -or $env:APPVEYOR_REPO_BRANCH -eq "master")
66-
if ($publishable) { #forcing a deploy flag for CI
67-
$Package = $true
68-
$BumpVersion = $true
69-
}
70-
7172
if ($BumpVersion) {
7273
Write-Output "Bumping the version"
7374
Bump-Version -BumpBuild -BuildNumber:$BuildNumber
@@ -79,6 +80,6 @@ if ($Package) {
7980
Write-Output "Building GitHub for Visual Studio"
8081
}
8182

82-
Build-Solution GitHubVs.sln "Build" $config -Deploy:$Package
83+
Build-Solution GitHubVs.sln "Build" $config -Deploy:$Package -ForVSInstaller:$ForVSInstaller
8384

8485
Pop-Location

scripts/modules.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ New-Module -ScriptBlock {
114114
$msbuild
115115
}
116116

117-
function Build-Solution([string]$solution, [string]$target, [string]$configuration, [switch]$ForVSInstaller, [bool]$Deploy = $false) {
117+
function Build-Solution([string]$solution, [string]$target, [string]$configuration, [switch]$ForVSInstaller = $false, [bool]$Deploy = $false) {
118118
$msbuild = Find-MSBuild
119119

120120
Run-Command -Fatal { & $nuget restore $solution -NonInteractive -Verbosity detailed -MSBuildPath (Split-Path -parent $msbuild) }

0 commit comments

Comments
 (0)