Skip to content

Commit f3e8d78

Browse files
Jordan Pierceclaude
andcommitted
Add marketplace publish step to CI workflow with README in VSIX
- Include README.md in VSIX packaging (added to vsix_staging in build step) - Add README.md as Microsoft.VisualStudio.Services.Content.Details asset in manifest - Add markdown content type to Content_Types.xml - Add publishManifest.json for VsixPublisher.exe - Add publish-to-marketplace step in CI (runs on push to master/main) - Step uses VsixPublisher.exe with MARKETPLACE_PAT secret Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 898dde5 commit f3e8d78

4 files changed

Lines changed: 70 additions & 0 deletions

File tree

.github/workflows/build.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ jobs:
4141
Copy-Item "vsix_template\extension.vsixmanifest" $staging
4242
Copy-Item "vsix_template\OffensiveVS360.pkgdef" $staging
4343
Copy-Item "vsix_template\Content_Types.xml" "$staging\[Content_Types].xml"
44+
Copy-Item "README.md" $staging
4445
4546
Get-ChildItem -Recurse $staging | ForEach-Object { Write-Host $_.FullName }
4647
Compress-Archive -Path "$staging\*" -DestinationPath "OffensiveVS360.vsix" -Force
@@ -53,3 +54,47 @@ jobs:
5354
path: OffensiveVS360.vsix
5455
if-no-files-found: error
5556
retention-days: 30
57+
58+
- name: Publish to Visual Studio Marketplace
59+
if: github.event_name == 'push' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main')
60+
shell: pwsh
61+
env:
62+
MARKETPLACE_PAT: ${{ secrets.MARKETPLACE_PAT }}
63+
run: |
64+
# Find VsixPublisher.exe from the Visual Studio installation
65+
$vsixPublisher = & "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" `
66+
-latest -products * -requires Microsoft.VisualStudio.Component.VSSDK `
67+
-find "VSSDK\VisualStudioIntegration\Tools\Bin\VsixPublisher.exe" 2>$null
68+
69+
if (-not $vsixPublisher) {
70+
# Try common VS 2022 paths
71+
$candidates = @(
72+
"${env:ProgramFiles}\Microsoft Visual Studio\2022\Enterprise\VSSDK\VisualStudioIntegration\Tools\Bin\VsixPublisher.exe",
73+
"${env:ProgramFiles}\Microsoft Visual Studio\2022\Professional\VSSDK\VisualStudioIntegration\Tools\Bin\VsixPublisher.exe",
74+
"${env:ProgramFiles}\Microsoft Visual Studio\2022\Community\VSSDK\VisualStudioIntegration\Tools\Bin\VsixPublisher.exe",
75+
"${env:ProgramFiles(x86)}\Microsoft Visual Studio\2022\BuildTools\VSSDK\VisualStudioIntegration\Tools\Bin\VsixPublisher.exe"
76+
)
77+
foreach ($c in $candidates) {
78+
if (Test-Path $c) { $vsixPublisher = $c; break }
79+
}
80+
}
81+
82+
if (-not $vsixPublisher) {
83+
Write-Error "VsixPublisher.exe not found. Install Visual Studio SDK component."
84+
exit 1
85+
}
86+
87+
Write-Host "Using VsixPublisher: $vsixPublisher"
88+
Write-Host "Publishing OffensiveVS360.vsix to Visual Studio Marketplace..."
89+
90+
& $vsixPublisher publish `
91+
-payload "OffensiveVS360.vsix" `
92+
-publishManifest "vsix_template\publishManifest.json" `
93+
-personalAccessToken "$env:MARKETPLACE_PAT" `
94+
-ignoreWarnings "VSIXValidatorWarning01,VSIXValidatorWarning02,VSIXValidatorWarning03"
95+
96+
if ($LASTEXITCODE -ne 0) {
97+
Write-Error "VsixPublisher failed with exit code $LASTEXITCODE"
98+
exit $LASTEXITCODE
99+
}
100+
Write-Host "Successfully published to Visual Studio Marketplace."

vsix_template/Content_Types.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@
44
<Default Extension="pkgdef" ContentType="text/plain" />
55
<Default Extension="png" ContentType="image/png" />
66
<Override PartName="/extension.vsixmanifest" ContentType="text/xml" />
7+
<Default Extension="md" ContentType="text/markdown" />
78
</Types>

vsix_template/extension.vsixmanifest

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,6 @@ Requires an O360 SAST server endpoint and API token.</Description>
2626
<Assets>
2727
<Asset Type="Microsoft.VisualStudio.VsPackage" Path="OffensiveVS360.pkgdef" />
2828
<Asset Type="Microsoft.VisualStudio.MefComponent" Path="OffensiveVS360.dll" />
29+
<Asset Type="Microsoft.VisualStudio.Services.Content.Details" Path="README.md" />
2930
</Assets>
3031
</PackageManifest>

vsix_template/publishManifest.json

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"categories": [
3+
"Tools",
4+
"Tools/Coding",
5+
"Tools/Programming Languages"
6+
],
7+
"priceCategory": "free",
8+
"galleryFlags": [
9+
"public"
10+
],
11+
"identity": {
12+
"internalName": "OffensiveVS360"
13+
},
14+
"overview": "README.md",
15+
"publisher": "Offensive360",
16+
"tags": [
17+
"security",
18+
"sast",
19+
"vulnerability",
20+
"appsec",
21+
"devsecops"
22+
]
23+
}

0 commit comments

Comments
 (0)