Skip to content

Commit 6e2f46b

Browse files
committed
Update CI build script to package and upload extension artifacts
1 parent ec44c31 commit 6e2f46b

File tree

2 files changed

+39
-4
lines changed

2 files changed

+39
-4
lines changed

appveyor.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version: '0.9.0.{build}'
1+
version: '0.9.1-insiders-{build}'
22
image: Visual Studio 2017 RC
33
clone_depth: 10
44
skip_tags: true
@@ -16,7 +16,7 @@ install:
1616
Install-Module InvokeBuild -RequiredVersion 3.2.1 -Scope CurrentUser -Force | Out-Null
1717
1818
build_script:
19-
- ps: Invoke-Build Build
19+
- ps: Invoke-Build
2020

2121
# The build script takes care of the tests
2222
test: off

vscode-powershell.build.ps1

Lines changed: 37 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,26 @@ param(
77
[string]$EditorServicesRepoPath = $null
88
)
99

10-
#Requires -Modules @{ModuleName="InvokeBuild";ModuleVersion="3.2.1"}
10+
#Requires -Modules @{ModuleName="InvokeBuild";ModuleVersion="3.0.0"}
11+
12+
task GetExtensionVersion {
13+
$updateVersion = $false
14+
15+
$script:ExtensionVersion = `
16+
if ($env:AppVeyor) {
17+
$updateVersion = $true
18+
$env:APPVEYOR_BUILD_VERSION
19+
}
20+
else {
21+
exec { & npm version | ConvertFrom-Json | ForEach-Object { $_.PowerShell } }
22+
}
23+
24+
Write-Host "`n### Extension Version: $script:ExtensionVersion`n" -ForegroundColor Green
25+
26+
if ($updateVersion) {
27+
exec { & npm version $script:ExtensionVersion --no-git-tag-version }
28+
}
29+
}
1130

1231
task ResolveEditorServicesPath -Before Clean, Build {
1332
$script:psesRepoPath = `
@@ -60,4 +79,20 @@ task Build {
6079
exec { & npm run compile }
6180
}
6281

63-
task . Clean, Build
82+
task Package {
83+
84+
if ($script:psesBuildScriptPath) {
85+
Write-Host "`n### Copying PowerShellEditorServices module files" -ForegroundColor Green
86+
Copy-Item -Recurse -Force ..\PowerShellEditorServices\module\PowerShellEditorServices .\modules
87+
}
88+
89+
Write-Host "`n### Packaging PowerShell-$($script:ExtensionVersion).vsix`n" -ForegroundColor Green
90+
exec { & vsce package }
91+
}
92+
93+
task UploadArtifacts -If { $env:AppVeyor } {
94+
Push-AppveyorArtifact .\PowerShell-$($script:ExtensionVersion).vsix
95+
}
96+
97+
# The default task is to run the entire CI build
98+
task . GetExtensionVersion, Clean, Build, Package, UploadArtifacts

0 commit comments

Comments
 (0)