Skip to content

Commit 4189529

Browse files
committed
Update release pipeline in devops
1 parent 5cf8cb9 commit 4189529

File tree

2 files changed

+130
-0
lines changed

2 files changed

+130
-0
lines changed

.azure-pipelines/release-dev.yml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# This pipeline is used to release the azure-toolkit-for-intellij from the nightly/stable build.
2+
# It contains following steps:
3+
# 1. Download the plugin artifact from the nightly/stable build pipeline.
4+
# 2. Publish the plugin to the marketplace.
5+
6+
name: $(Date:yyyyMMdd).$(Rev:r) # Use the current date and a revision number for the build name.
7+
8+
variables:
9+
- name: Codeql.Enabled
10+
value: true
11+
resources:
12+
repositories:
13+
- repository: self
14+
type: git
15+
ref: refs/heads/main
16+
- repository: 1esPipelines
17+
type: git
18+
name: 1ESPipelineTemplates/1ESPipelineTemplates
19+
ref: refs/tags/release
20+
trigger: none
21+
extends:
22+
template: v1/1ES.Official.PipelineTemplate.yml@1esPipelines
23+
parameters:
24+
pool:
25+
os: linux
26+
name: 1ES_JavaTooling_Pool
27+
image: 1ES_JavaTooling_Ubuntu-2004
28+
stages:
29+
- stage: Release
30+
jobs:
31+
- job: Job
32+
displayName: Release VS Code Java Pack Extension
33+
templateContext:
34+
type: releaseJob
35+
isProduction: true
36+
inputs:
37+
- input: pipelineArtifact
38+
buildType: specific
39+
project: $(AzDo.ProjectId) # Azure DevOps project ID
40+
definition: $(AzDo.BuildPipelineId) # artifact build pipeline ID
41+
artifactName: drop
42+
downloadType: specific
43+
targetPath: '$(Build.SourcesDirectory)'
44+
steps:
45+
- task: AzureCLI@2
46+
displayName: 'VSCE Publish'
47+
inputs:
48+
azureSubscription: 'VSCode-Ext-Publishing'
49+
scriptType: pscore
50+
scriptLocation: inlineScript
51+
inlineScript: |
52+
$files = Get-ChildItem -Path "$(Build.SourcesDirectory)" -Recurse -Filter "azure-toolkit-for-intellij-*.zip"
53+
54+
foreach ($file in $files) {
55+
$headers = @{
56+
"Authorization" = "Bearer $(TOKEN)"
57+
}
58+
$form = @{
59+
"pluginId" = "8053"
60+
"file" = Get-Item $file.FullName
61+
"channel" = "dev"
62+
}
63+
64+
Invoke-RestMethod -Uri "https://plugins.jetbrains.com/plugin/uploadPlugin" -Method Post -Headers $headers -Form $form -Verbose
65+
}

.azure-pipelines/release-stable.yml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# This pipeline is used to release the azure-toolkit-for-intellij from the nightly/stable build.
2+
# It contains following steps:
3+
# 1. Download the plugin artifact from the nightly/stable build pipeline.
4+
# 2. Publish the plugin to the marketplace.
5+
6+
name: $(Date:yyyyMMdd).$(Rev:r) # Use the current date and a revision number for the build name.
7+
8+
variables:
9+
- name: Codeql.Enabled
10+
value: true
11+
resources:
12+
repositories:
13+
- repository: self
14+
type: git
15+
ref: refs/heads/main
16+
- repository: 1esPipelines
17+
type: git
18+
name: 1ESPipelineTemplates/1ESPipelineTemplates
19+
ref: refs/tags/release
20+
trigger: none
21+
extends:
22+
template: v1/1ES.Official.PipelineTemplate.yml@1esPipelines
23+
parameters:
24+
pool:
25+
os: linux
26+
name: 1ES_JavaTooling_Pool
27+
image: 1ES_JavaTooling_Ubuntu-2004
28+
stages:
29+
- stage: Release
30+
jobs:
31+
- job: Job
32+
displayName: Release VS Code Java Pack Extension
33+
templateContext:
34+
type: releaseJob
35+
isProduction: true
36+
inputs:
37+
- input: pipelineArtifact
38+
buildType: specific
39+
project: $(AzDo.ProjectId) # Azure DevOps project ID
40+
definition: $(AzDo.BuildPipelineId) # artifact build pipeline ID
41+
artifactName: drop
42+
downloadType: specific
43+
targetPath: '$(Build.SourcesDirectory)'
44+
steps:
45+
- task: AzureCLI@2
46+
displayName: 'VSCE Publish'
47+
inputs:
48+
azureSubscription: 'VSCode-Ext-Publishing'
49+
scriptType: pscore
50+
scriptLocation: inlineScript
51+
inlineScript: |
52+
$files = Get-ChildItem -Path "$(Build.SourcesDirectory)" -Recurse -Filter "azure-toolkit-for-intellij-*.zip"
53+
54+
foreach ($file in $files) {
55+
$headers = @{
56+
"Authorization" = "Bearer $(TOKEN)"
57+
}
58+
$form = @{
59+
"pluginId" = "8053"
60+
"file" = Get-Item $file.FullName
61+
"channel" = "stable"
62+
}
63+
64+
Invoke-RestMethod -Uri "https://plugins.jetbrains.com/plugin/uploadPlugin" -Method Post -Headers $headers -Form $form -Verbose
65+
}

0 commit comments

Comments
 (0)