-
Notifications
You must be signed in to change notification settings - Fork 10
/
azure-pipelines.yml
84 lines (63 loc) · 2.22 KB
/
azure-pipelines.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# Node.js
# Build a general Node.js project with npm.
# Add steps that analyze code, save build artifacts, deploy, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/javascript
trigger:
- main
pool:
vmImage: ubuntu-latest
variables:
- group: vscode-autoscript-deploy
steps:
- task: NodeTool@0
inputs:
versionSpec: '18.x'
displayName: 'Install Node.js'
- script: npm install
displayName: Install NPM
- bash: |
sudo npm install -g webpack
sudo npm install -g vsce
displayName: Install VSCE and Webpack
- script: npm run vsce:package
displayName: Create VSIX
env:
GITHUB_PAT: $(github_pat)
# For releasable builds, we'll want the branch
# Expects that a 'version.txt' has been laid down by a previous step
- bash: |
PACKAGE_VERSION=$(node -p "require('./package.json').version")
echo "$PACKAGE_VERSION" > version.txt
echo $(Build.SourceBranch) | sed "s|refs/[^/]*/||" > branch.txt
VERSION_REGEX="## $(echo $PACKAGE_VERSION | sed 's/\./\\./g')"
displayName: Get branch
# Choose files to publish
- task: CopyFiles@2
displayName: Stage VSIX for publishing
inputs:
contents: |-
*.vsix
version.txt
branch.txt
targetFolder: $(Build.ArtifactStagingDirectory)
# Publish files as an artifact
- task: PublishPipelineArtifact@1
displayName: Publish VSIX
inputs:
artifact: script-deploy-vs-code
targetPath: $(Build.ArtifactStagingDirectory)
- bash: |
PACKAGE_VERSION=$(cat version.txt)
vsce publish -p $(marketplace_pat) --packagePath $(Build.ArtifactStagingDirectory)/maximo-script-deploy-$PACKAGE_VERSION.vsix
displayName: 'Publish to Marketplace'
- bash: |
git config --local user.name "Jason VenHuizen"
git config --local user.email "[email protected]"
git remote add github https://jvenhuizen:$(github_pat)@github.com/sharptree/vscode-autoscript-deploy.git
git push github HEAD:main
PACKAGE_VERSION=$(cat version.txt)
if [ ! $(git tag -l "release/$PACKAGE_VERSION") ]; then
git tag "release/$PACKAGE_VERSION"
fi
git push github release/$PACKAGE_VERSION
displayName: 'Publish GitHub'