-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
50 lines (49 loc) · 1.65 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
trigger:
- main
stages:
- stage: Build
displayName: Build and package
jobs:
- job: Build
displayName: Build and package
pool:
vmImage: "ubuntu-latest"
steps:
- task: NodeTool@0
displayName: Use Node 12.x
inputs:
versionSpec: "12.x"
- script: |
sudo curl -sfL https://install.goreleaser.com/github.com/tj/node-prune.sh | sudo bash -s -- -b /usr/local/bin
displayName: Install node-prune
- script: |
npm install
displayName: npm install
- script: |
npm run build
displayName: npm run build
- script: |
npm prune --production
displayName: npm prune
- script: |
/usr/local/bin/node-prune
displayName: execute node-prune
- task: CopyFiles@2
displayName: Only publish files needed for runtime
inputs:
SourceFolder: "$(System.DefaultWorkingDirectory)"
Contents: |
dist/**
library/**
package.json
node_modules/**
TargetFolder: "$(Build.ArtifactStagingDirectory)"
- task: ArchiveFiles@2
inputs:
rootFolderOrFile: "$(Build.ArtifactStagingDirectory)"
includeRootFolder: false
archiveFile: "$(Build.ArtifactStagingDirectory)/$(appName).zip"
archiveType: zip
- task: PublishPipelineArtifact@1
inputs:
targetPath: "$(Build.ArtifactStagingDirectory)/$(appName).zip"