Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix publish step #178

Merged
merged 4 commits into from
Nov 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 0 additions & 51 deletions .azure/azure-pipelines-prerelease.yml

This file was deleted.

6 changes: 1 addition & 5 deletions .azure/azure-pipelines-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,11 @@ extends:
nodeVersion: ${{ parameters.nodeVersion }}
signType: 'real'

# - template: stages/sign.yml
# parameters:
# signType: 'real'
# nodeVersion: ${{ parameters.nodeVersion }}

# Stage provides a manual approval step before the publish stage is run
- template: stages/approval.yml

# Publish the VSIX to the extension marketplace
- template: stages/publish.yml
parameters:
isPreRelease: ${{ parameters.isPreRelease }}
nodeVersion: ${{ parameters.nodeVersion }}
16 changes: 14 additions & 2 deletions .azure/stages/publish.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
parameters:
- name: isPreRelease
type: boolean
- name: nodeVersion
type: string

stages:
- stage: Publish
Expand All @@ -14,6 +16,11 @@ stages:
- name: vsixName
value: $[ stageDependencies.Build.Build.outputs['SetExtensionName.VSIX'] ]
steps:
- task: NodeTool@0
displayName: 🔨 Install Node.js
inputs:
versionSpec: ${{ parameters.nodeVersion }}

- download: current
artifact: extension
displayName: 🚚 Download extension artifact
Expand All @@ -26,18 +33,23 @@ stages:
artifact: extension-signature
displayName: 🚚 Download extension signature artifact

# Copy everything into the same folder before we run the publish. For some reason this is needed for the publish command.
- script: |
cp $(Pipeline.Workspace)/extension/$(vsixName) .
cp $(Pipeline.Workspace)/extension-manifest/$(vsixName).manifest .
cp $(Pipeline.Workspace)/extension-signature/$(vsixName).signature.p7s .

- ${{ if parameters.isPreRelease }}:
- bash: echo "Publishing PreRelease"
- script: npx @vscode/vsce@latest publish --packagePath $(Pipeline.Workspace)/extension/$(vsixName) --manifestPath $(Pipeline.Workspace)/extension-manifest/$(vsixName).manifest --signaturePath $(Pipeline.Workspace)/extension-signature/$(vsixName).signature.p7s --pre-release
- script: npx @vscode/vsce@latest publish --packagePath $(vsixName) --manifestPath $(vsixName).manifest --signaturePath $(vsixName).signature.p7s --pre-release
displayName: Publish pre-release extension
env:
# Marketplace PAT needs to be uploaded as a pipeline variable
VSCE_PAT: $(marketplace-pat)

- ${{ else }}:
- bash: echo "Publishing Release"
- script: npx @vscode/vsce@latest publish --packagePath $(Pipeline.Workspace)/extension/$(vsixName) --manifestPath $(Pipeline.Workspace)/extension-manifest/$(vsixName).manifest --signaturePath $(Pipeline.Workspace)/extension-signature/$(vsixName).signature.p7s
- script: npx @vscode/vsce@latest publish --packagePath $(vsixName) --manifestPath $(vsixName).manifest --signaturePath $(vsixName).signature.p7s
displayName: Publish extension
env:
VSCE_PAT: $(marketplace-pat)
Loading