-
Notifications
You must be signed in to change notification settings - Fork 13
86 lines (73 loc) · 2.83 KB
/
Copy pathpublish-visualstudio.yml
File metadata and controls
86 lines (73 loc) · 2.83 KB
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
name: Publish Visual Studio Extension
on:
push:
tags:
- "vs-v*"
workflow_dispatch:
jobs:
publish:
runs-on: windows-latest
permissions:
contents: write
defaults:
run:
working-directory: visualstudio-extension
steps:
- uses: actions/checkout@v4
- name: Setup MSBuild
uses: microsoft/setup-msbuild@v2
- name: Setup NuGet
uses: nuget/setup-nuget@v2
- name: Restore NuGet packages
run: nuget restore DevGlobe.sln
- name: Build VSIX (Release)
run: msbuild DevGlobe.sln /t:Rebuild /p:Configuration=Release /p:DeployExtension=false
- name: Locate VSIX
id: vsix
shell: pwsh
run: |
$vsix = Get-ChildItem -Path . -Recurse -Filter *.vsix |
Where-Object { $_.FullName -match 'bin\\Release' } |
Select-Object -First 1
if (-not $vsix) {
Write-Error "No .vsix found under bin\Release"
exit 1
}
Write-Host "Found VSIX: $($vsix.FullName)"
"path=$($vsix.FullName)" >> $env:GITHUB_OUTPUT
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
files: ${{ steps.vsix.outputs.path }}
body: |
## DevGlobe for Visual Studio
Built from commit ${{ github.sha }}
### Install manually
1. Download the `.vsix` file below
2. Double-click it (or use **Extensions → Manage Extensions → Install from VSIX…**)
3. Restart Visual Studio
generate_release_notes: true
- name: Publish to Visual Studio Marketplace
shell: pwsh
env:
# Réutilise le PAT Azure DevOps déjà utilisé pour VS Code (scope Marketplace › Manage,
# compte propriétaire du publisher "devglobe"). Même type de token, même marketplace.
MARKETPLACE_PAT: ${{ secrets.VSCE_PAT }}
run: |
# Locate VsixPublisher.exe (ships with the VS SDK component) via vswhere.
$vswhere = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe"
$vsRoot = & $vswhere -latest -prerelease -property installationPath
$publisher = Join-Path $vsRoot "VSSDK\VisualStudioIntegration\Tools\Bin\VsixPublisher.exe"
if (-not (Test-Path $publisher)) {
Write-Error "VsixPublisher.exe not found at $publisher"
exit 1
}
Write-Host "Using VsixPublisher: $publisher"
& $publisher publish `
-payload "${{ steps.vsix.outputs.path }}" `
-publishManifest "publishManifest.json" `
-personalAccessToken $env:MARKETPLACE_PAT
if ($LASTEXITCODE -ne 0) {
Write-Error "VsixPublisher publish failed with exit code $LASTEXITCODE"
exit $LASTEXITCODE
}