Skip to content

Commit 2752598

Browse files
committed
Removed all --allow-proposed-apis logic (and the EnabledApiProposalsJson env wiring) from publish.yml.
Updated both publish paths to use --no-verify (correct flag name; --noVerify won’t work): Pre-release: adds --no-verify --pre-release Stable: adds --no-verify This should avoid the unknown option '--allow-proposed-apis …' failure entirely by no longer passing that option.
1 parent f0a8a66 commit 2752598

File tree

1 file changed

+4
-41
lines changed

1 file changed

+4
-41
lines changed

build/templates/publish.yml

Lines changed: 4 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,6 @@ steps:
7171
- ${{ each platform in parameters.buildPlatforms }}:
7272
- task: PowerShell@2
7373
displayName: "Publish extension (${{ coalesce(platform.vsceTarget, 'universal') }})"
74-
env:
75-
EnabledApiProposalsJson: ${{ parameters.enabledApiProposalsJson }}
7674
inputs:
7775
targetType: inline
7876
script: |
@@ -105,51 +103,16 @@ steps:
105103
Write-Host "Listing platform folder contents:"
106104
Get-ChildItem $root | Select-Object Name,Length | Format-Table -AutoSize
107105
108-
# If the extension uses proposed APIs, vsce requires explicitly allowing them.
109-
# We expect EnabledApiProposalsJson to be set by an earlier step (e.g. publish-extension.yml).
110-
$allowProposedApisArgs = @()
111-
$enabledApiProposalsJson = $env:EnabledApiProposalsJson
112-
if ([string]::IsNullOrWhiteSpace($enabledApiProposalsJson)) {
113-
Write-Host "EnabledApiProposalsJson is not set; publishing without --allow-proposed-apis."
114-
} else {
115-
try {
116-
$parsedEnabledApiProposals = ConvertFrom-Json -InputObject $enabledApiProposalsJson
117-
$enabledApiProposals = @()
118-
119-
if ($null -ne $parsedEnabledApiProposals) {
120-
foreach ($proposal in @($parsedEnabledApiProposals)) {
121-
if (-not [string]::IsNullOrWhiteSpace([string]$proposal)) {
122-
$enabledApiProposals += [string]$proposal
123-
}
124-
}
125-
}
126-
127-
if ($enabledApiProposals.Count -gt 0) {
128-
Write-Host ("enabledApiProposals (from EnabledApiProposalsJson): " + ($enabledApiProposals -join ', '))
129-
$allowProposedApisArgs = @('--allow-proposed-apis') + $enabledApiProposals
130-
} else {
131-
Write-Host "EnabledApiProposalsJson parsed as empty; no proposed API allowlist flags needed."
132-
}
133-
} catch {
134-
Write-Host "EnabledApiProposalsJson was set but could not be parsed; publishing without --allow-proposed-apis."
135-
}
136-
}
137-
138-
$allowProposedApisDisplay = ($allowProposedApisArgs -join ' ')
139-
140106
if ('${{ parameters.preRelease }}' -eq 'True') {
141107
Write-Host 'Publishing as pre-release'
142-
$displayCmd = "Executing: npx @vscode/vsce@latest publish --pat *** --packagePath $vsixPath --manifestPath $manifestPath --signaturePath $signaturePath"
143-
if ($allowProposedApisDisplay) { $displayCmd += " $allowProposedApisDisplay" }
144-
$displayCmd += ' --pre-release'
108+
$displayCmd = "Executing: npx @vscode/vsce@latest publish --pat *** --packagePath $vsixPath --manifestPath $manifestPath --signaturePath $signaturePath --no-verify --pre-release"
145109
Write-Host $displayCmd
146-
npx @vscode/vsce@latest publish --pat $aadToken --packagePath $vsixPath --manifestPath $manifestPath --signaturePath $signaturePath $allowProposedApisArgs --pre-release
110+
npx @vscode/vsce@latest publish --pat $aadToken --packagePath $vsixPath --manifestPath $manifestPath --signaturePath $signaturePath --no-verify --pre-release
147111
} else {
148112
Write-Host 'Publishing as stable release'
149-
$displayCmd = "Executing: npx @vscode/vsce@latest publish --pat *** --packagePath $vsixPath --manifestPath $manifestPath --signaturePath $signaturePath"
150-
if ($allowProposedApisDisplay) { $displayCmd += " $allowProposedApisDisplay" }
113+
$displayCmd = "Executing: npx @vscode/vsce@latest publish --pat *** --packagePath $vsixPath --manifestPath $manifestPath --signaturePath $signaturePath --no-verify"
151114
Write-Host $displayCmd
152-
npx @vscode/vsce@latest publish --pat $aadToken --packagePath $vsixPath --manifestPath $manifestPath --signaturePath $signaturePath $allowProposedApisArgs
115+
npx @vscode/vsce@latest publish --pat $aadToken --packagePath $vsixPath --manifestPath $manifestPath --signaturePath $signaturePath --no-verify
153116
}
154117
155118
if ($LASTEXITCODE -ne 0) {

0 commit comments

Comments
 (0)