Skip to content

Commit

Permalink
Update azure-pipelines.yml for Azure Pipelines
Browse files Browse the repository at this point in the history
  • Loading branch information
jessehouwing committed Jun 11, 2024
1 parent ff280a9 commit a994947
Showing 1 changed file with 13 additions and 39 deletions.
52 changes: 13 additions & 39 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ variables:
value: '0.x'
- name: 'nodeVersion'
value: '16.x'
- name: 'marketplaceServiceConnection'
value: '24325a98-0d4b-4180-9936-c930a4156258'

stages:
- stage: 'Build'
Expand Down Expand Up @@ -48,13 +46,13 @@ stages:
- script: |
npm run build
- task: TfxInstaller@4
- task: TfxInstaller@5
displayName: 'Use Node CLI for Azure DevOps'
inputs:
version: $(tfxVersion)
checkLatest: true

- task: PackageAzureDevOpsExtension@4
- task: PackageAzureDevOpsExtension@5
displayName: 'Package Extension: $(Build.SourcesDirectory)'
name: 'packageStep'
inputs:
Expand Down Expand Up @@ -131,24 +129,12 @@ stages:
versionSpec: $(nodeVersion)
displayName: 'Install Node.js'

- task: TfxInstaller@4
- task: TfxInstaller@5
displayName: 'Use Node CLI for Azure DevOps'
inputs:
version: $(tfxVersion)
checkLatest: true

#- task: AzureCLI@2
# displayName: 'Authenticate with Service Principal'
# inputs:
# azureSubscription: 'azure-devops-marketplace'
# scriptType: 'pscore'
# scriptLocation: 'inlineScript'
# useGlobalConfig: true
# inlineScript: |
# $accessToken = az account get-access-token --resource 499b84ac-1321-427f-aa17-267ca6975798 --query "accessToken" --output tsv
# write-host "##vso[task.setsecret]$accessToken"
# write-host "##vso[task.setendpoint id=$env:MARKETPLACESERVICECONNECTION;field=authParameter;key=password]$accessToken"

- task: PublishAzureDevOpsExtension@5
name: 'publishDev'
inputs:
Expand All @@ -164,10 +150,10 @@ stages:
shareWith: 'jessehouwing-dev'
noWaitValidation: true

- task: IsAzureDevOpsExtensionValid@4
- task: IsAzureDevOpsExtensionValid@5
inputs:
connectTo: 'VsTeam'
connectedServiceName: '$(marketplaceServiceConnection)'
connectTo: 'AzureRM'
connectedServiceNameAzureRM: 'azure-devops-marketplace'
method: 'vsix'
vsixFile: '$(publishDev.Extension.OutputPath)'

Expand Down Expand Up @@ -197,29 +183,17 @@ stages:
versionSpec: $(nodeVersion)
displayName: 'Install Node.js'

- task: TfxInstaller@4
- task: TfxInstaller@5
displayName: 'Use Node CLI for Azure DevOps'
inputs:
version: $(tfxVersion)
checkLatest: true

- task: AzureCLI@2
displayName: 'Authenticate with Service Principal'
inputs:
azureSubscription: 'azure-devops-marketplace'
scriptType: 'pscore'
scriptLocation: 'inlineScript'
useGlobalConfig: true
inlineScript: |
$accessToken = az account get-access-token --resource 499b84ac-1321-427f-aa17-267ca6975798 --query "accessToken" --output tsv
write-host "##vso[task.setsecret]$accessToken"
write-host "##vso[task.setendpoint id=$env:MARKETPLACESERVICECONNECTION;field=authParameter;key=password]$accessToken"
- task: PublishAzureDevOpsExtension@4
- task: PublishAzureDevOpsExtension@5
name: 'publishProd'
inputs:
connectTo: 'VsTeam'
connectedServiceName: '$(marketplaceServiceConnection)'
connectTo: 'AzureRM'
connectedServiceNameAzureRM: 'azure-devops-marketplace'
fileType: 'vsix'
vsixFile: '$(Pipeline.Workspace)/vsix/$(extensionId).vsix'
publisherId: 'jessehouwing'
Expand All @@ -228,10 +202,10 @@ stages:
extensionVisibility: 'public'
noWaitValidation: true

- task: IsAzureDevOpsExtensionValid@4
- task: IsAzureDevOpsExtensionValid@5
inputs:
connectTo: 'VsTeam'
connectedServiceName: '$(marketplaceServiceConnection)'
connectTo: 'AzureRM'
connectedServiceNameAzureRM: 'azure-devops-marketplace'
method: 'vsix'
vsixFile: '$(publishProd.Extension.OutputPath)'

Expand Down

0 comments on commit a994947

Please sign in to comment.