9
9
10
10
# Requires -Modules @ {ModuleName = " InvokeBuild" ;ModuleVersion = " 3.0.0" }
11
11
12
+ $script :IsPullRequestBuild =
13
+ $env: APPVEYOR_PULL_REQUEST_NUMBER -and
14
+ $env: APPVEYOR_REPO_BRANCH -eq " develop"
15
+
12
16
task GetExtensionVersion - Before Package {
17
+
13
18
$updateVersion = $false
14
19
$script :ExtensionVersion = `
15
20
if ($env: AppVeyor ) {
@@ -28,6 +33,7 @@ task GetExtensionVersion -Before Package {
28
33
}
29
34
30
35
task ResolveEditorServicesPath - Before Clean , Build {
36
+
31
37
$script :psesRepoPath = `
32
38
if ($EditorServicesRepoPath ) {
33
39
$EditorServicesRepoPath
@@ -48,6 +54,7 @@ task ResolveEditorServicesPath -Before Clean, Build {
48
54
}
49
55
50
56
task Restore - If { " Restore" -in $BuildTask -or ! (Test-Path " ./node_modules" ) } - Before Build {
57
+
51
58
Write-Host " `n ### Restoring vscode-powershell dependencies`n " - ForegroundColor Green
52
59
53
60
# When in a CI build use the --loglevel=error parameter so that
@@ -57,6 +64,7 @@ task Restore -If { "Restore" -in $BuildTask -or !(Test-Path "./node_modules") }
57
64
}
58
65
59
66
task Clean {
67
+
60
68
if ($script :psesBuildScriptPath ) {
61
69
Write-Host " `n ### Cleaning PowerShellEditorServices`n " - ForegroundColor Green
62
70
Invoke-Build Clean $script :psesBuildScriptPath
@@ -89,7 +97,8 @@ task Package {
89
97
exec { & node ./ node_modules/ vsce/ out/ vsce package }
90
98
}
91
99
92
- task UploadArtifacts - If { $env: AppVeyor } {
100
+ task UploadArtifacts - If { $env: AppVeyor -and ! $script :IsPullRequestBuild -and $env: APPVEYOR_REPO_BRANCH -eq " develop" } {
101
+
93
102
Push-AppveyorArtifact .\PowerShell- $ ($script :ExtensionVersion ).vsix
94
103
}
95
104
0 commit comments