|
| 1 | +# Starter pipeline |
| 2 | +# Start with a minimal pipeline that you can customize to build and deploy your code. |
| 3 | +# Add steps that build, run tests, deploy, and more: |
| 4 | +# https://aka.ms/yaml |
| 5 | + |
| 6 | +trigger: |
| 7 | +- master |
| 8 | + |
| 9 | +pool: |
| 10 | + vmImage: 'vs2017-win2016' |
| 11 | + |
| 12 | +variables: |
| 13 | + update_type: patch |
| 14 | + group: build_vars |
| 15 | + system.debug: true |
| 16 | + |
| 17 | +steps: |
| 18 | +- checkout: self |
| 19 | + persistCredentials: true |
| 20 | + |
| 21 | +- task: Npm@1 |
| 22 | + displayName: 'npm install' |
| 23 | + inputs: |
| 24 | + verbose: true |
| 25 | + |
| 26 | +- powershell: | |
| 27 | + Write-Host "vsce setup" |
| 28 | + npm install vsce -g |
| 29 | + displayName: 'install vsce' |
| 30 | + |
| 31 | +- powershell: | |
| 32 | + npm config set package-lock false |
| 33 | + displayName: 'npm disable package lock' |
| 34 | + |
| 35 | +- powershell: | |
| 36 | + if ((test-path .\package-lock.json) -eq "True") {rm package-lock.json -force} else {} |
| 37 | + displayName: "remove package lock if present" |
| 38 | + |
| 39 | +- powershell: | |
| 40 | + (Get-Content -Raw .\snippets\snippets.json | ConvertFrom-Json) |
| 41 | + (Get-Content -Raw .\snippets\yaml-snippets.json | ConvertFrom-Json) |
| 42 | + displayName: "validate extension JSON schema" |
| 43 | + |
| 44 | +- powershell: | |
| 45 | + Write-Host "setting up git properties for npm version" |
| 46 | + git config --global user.email "you@example.com" |
| 47 | + git config --global user.name "AWS Scripting Guy from Azure DevOps" |
| 48 | + displayName: "set up git properties" |
| 49 | + |
| 50 | +- powershell: | |
| 51 | + git status |
| 52 | + git show |
| 53 | + git checkout release/azure-pipelines |
| 54 | + displayName: "git checkout release/azure-pipelines" |
| 55 | + |
| 56 | +- powershell: | |
| 57 | + Write-Host "npm version $(UPDATE_TYPE)" |
| 58 | + npm version |
| 59 | + npm version $(UPDATE_TYPE) -m "***NO_CI*** %s" |
| 60 | + displayName: 'update version field in package.json' |
| 61 | + |
| 62 | +- powershell: | |
| 63 | + Write-Host "vsce package" |
| 64 | + vsce package |
| 65 | + displayName: 'package into .vsix' |
| 66 | + |
| 67 | +- powershell: | |
| 68 | + git status |
| 69 | + git show |
| 70 | +# git push |
| 71 | + displayName: "push updated package.json to remote git" |
| 72 | + |
| 73 | +- task: CopyFiles@2 |
| 74 | + displayName: 'Copy Files to Artifact Directory)' |
| 75 | + inputs: |
| 76 | + Contents: | |
| 77 | + **\*.vsix |
| 78 | + **\package.json |
| 79 | + TargetFolder: '$(Build.ArtifactStagingDirectory)' |
| 80 | + |
| 81 | +- task: PublishBuildArtifacts@1 |
| 82 | + displayName: 'Publish Artifact' |
| 83 | + inputs: |
| 84 | + pathtoPublish: $(Build.ArtifactStagingDirectory) |
| 85 | + artifactName: MyBuildOutputs |
0 commit comments