-
Notifications
You must be signed in to change notification settings - Fork 385
Utilize a separate pipeline for release tasks #2515
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
base: main
Are you sure you want to change the base?
Changes from all commits
8227f39
a49d632
dceb185
1eeb718
4bf9172
61d8987
3db9861
5b2d054
9d5b10f
719c36a
6c0039b
d3bce10
18dc1ce
143d1a3
6d42a37
452e9fb
b6bc1e2
357e656
283f93d
af472e4
bf9abc4
5197cfc
cd52562
ddd0f98
b9677a9
b17ea7c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,121 @@ | ||
| trigger: none | ||
| pr: none | ||
|
|
||
| parameters: | ||
| - name: test | ||
| type: boolean | ||
| default: true | ||
|
|
||
| variables: | ||
| # This is expected to provide the PAT used to tag the release. | ||
| - group: DncEng-Partners-Tokens | ||
|
|
||
| resources: | ||
| repositories: | ||
| - repository: 1ESPipelineTemplates | ||
| type: git | ||
| name: 1ESPipelineTemplates/1ESPipelineTemplates | ||
| ref: refs/tags/release | ||
| pipelines: | ||
| - pipeline: officialBuildCI | ||
| source: dotnet-vscode-dotnet-runtime | ||
| branch: main | ||
| extends: | ||
| template: v1/1ES.Official.PipelineTemplate.yml@1ESPipelineTemplates | ||
| parameters: | ||
| pool: | ||
| name: NetCore1ESPool-Internal | ||
| image: 1es-windows-2022 | ||
| os: windows | ||
| customBuildTags: | ||
| - ES365AIMigrationTooling | ||
| stages: | ||
| - stage: PublishStage | ||
| jobs: | ||
| - deployment: PublishToMarketplace | ||
| displayName: PublishToMarketplace | ||
| environment: vscode-dotnetcore-extension-releases | ||
| pool: | ||
| name: NetCore1ESPool-Internal | ||
| image: 1es-windows-2022 | ||
| os: windows | ||
| templateContext: | ||
| type: releaseJob | ||
| isProduction: true | ||
| inputs: | ||
| - input: pipelineArtifact | ||
| pipeline: officialBuildCI | ||
| artifactName: vscode-dotnet-runtime-extension | ||
| destinationPath: $(Pipeline.Workspace) | ||
| - input: pipelineArtifact | ||
| pipeline: officialBuildCI | ||
| artifactName: package_files | ||
| destinationPath: $(Pipeline.Workspace)/package_files | ||
| strategy: | ||
| runOnce: | ||
| deploy: | ||
| steps: | ||
| - template: pipeline-templates/install-node.yaml@self | ||
| - template: pipeline-templates/list-file-structure.yaml@self | ||
| - bash: | | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Any reason this script needs to be bash on Windows? It then requires the script to run under WSL. Copilot could probably directly convert this to PowerShell pretty easily. Then, this entire job just uses PowerShell. |
||
| ARTIFACT_DIR="$(Pipeline.Workspace)" | ||
| VSIX_PATH=$(find "$ARTIFACT_DIR" -type f -name 'vscode-dotnet-runtime-*.vsix' | head -n 1) | ||
| if [ -z "$VSIX_PATH" ]; then | ||
| echo "##vso[task.logissue type=error]Unable to locate vscode-dotnet-runtime-*.vsix under $ARTIFACT_DIR" | ||
| exit 1 | ||
| fi | ||
|
|
||
| FILE_NAME=$(basename "$VSIX_PATH") | ||
| VERSION=${FILE_NAME#vscode-dotnet-runtime-} | ||
| VERSION=${VERSION%.vsix} | ||
|
|
||
| echo "Using version $VERSION derived from artifact $FILE_NAME" | ||
|
|
||
| PACKAGE_FILES_DIR="$ARTIFACT_DIR/package_files" | ||
| if [ -f "$PACKAGE_FILES_DIR/package.json" ]; then | ||
| (cd "$PACKAGE_FILES_DIR" && npm version "$VERSION" --allow-same-version) | ||
| fi | ||
|
|
||
| echo "##vso[task.setvariable variable=version;isOutput=true]$VERSION" | ||
| name: GetVersion | ||
| displayName: '❓ Get Version' | ||
| - pwsh: | | ||
| $packageFilesDir = Join-Path '$(Pipeline.Workspace)' 'package_files' | ||
| if (-not (Test-Path $packageFilesDir)) { | ||
| Write-Error "package_files artifact was not downloaded." | ||
| exit 1 | ||
| } | ||
|
|
||
| Push-Location $packageFilesDir | ||
| try { | ||
| npm ci | ||
| } | ||
| finally { | ||
| Pop-Location | ||
| } | ||
| displayName: '⬇️ Restore Node Dependencies' | ||
| - task: AzureCLI@2 | ||
| displayName: '🚀 Publish to Marketplace' | ||
| inputs: | ||
| azureSubscription: 'VSCode Marketplace Publishing' | ||
| scriptType: "pscore" | ||
| scriptLocation: 'inlineScript' | ||
| workingDirectory: '$(Pipeline.Workspace)/package_files' | ||
| inlineScript: | | ||
| $packagePath = Join-Path '$(Pipeline.Workspace)' 'vscode-dotnet-runtime-$(GetVersion.version).vsix' | ||
| $manifestPath = Join-Path '$(Pipeline.Workspace)' 'vscode-dotnet-runtime-$(GetVersion.version).manifest' | ||
| $signaturePath = Join-Path '$(Pipeline.Workspace)' 'vscode-dotnet-runtime-$(GetVersion.version).signature.p7s' | ||
|
|
||
| $publishArgs = @('publish', '--azure-credential', '--packagePath', $packagePath, '--manifestPath', $manifestPath, '--signaturePath', $signaturePath) | ||
| $publishArgsString = $publishArgs -join ' ' | ||
| If (${{ parameters.test }}) { | ||
| Write-Host "With a test-signed build, the command to publish is printed instead of run." | ||
| Write-Host "##[command]npx vsce $publishArgsString" | ||
|
|
||
| Write-Host "🔒 Verify PAT." | ||
| npx vsce verify-pat --azure-credential ms-dotnettools | ||
| } | ||
| Else { | ||
| Write-Host "##[command]npx vsce $publishArgsString" | ||
| npx vsce $publishArgs | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: For consistency, keep list elements,
- {prop}, aligned with the parent property. Thus,You did this with
variables:andrepositories:and other stuff below. It still works if it is indented extra, but it just adds to confusion about YAML if they're all not the same.