-
Notifications
You must be signed in to change notification settings - Fork 36
/
Copy pathazure-pipelines.yml
92 lines (81 loc) · 3.54 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
85
86
87
88
89
90
91
92
# Variable 'prerelease' was defined in the Variables tab
# Variable 'prereleaseTag' was defined in the Variables tab
# Variable 'publishVersion' was defined in the Variables tab
# Variable 'skipPublish' was defined in the Variables tab with default value 'false'
variables:
- group: 'Github and NPM secrets'
- name: tags
value: production,externalfacing
resources:
repositories:
- repository: 1esPipelines
type: git
name: 1ESPipelineTemplates/1ESPipelineTemplates
ref: refs/tags/release
extends:
template: v1/1ES.Official.PipelineTemplate.yml@1esPipelines
parameters:
pool:
name: Azure-Pipelines-1ESPT-ExDShared
image: windows-latest
os: windows # We need windows because compliance task only run on windows.
stages:
- stage: main
jobs:
- job: Release
pool:
name: '1ES-Host-Ubuntu'
image: '1ES-PT-Ubuntu-20.04'
os: linux
workspace:
clean: all
templateContext:
outputs:
- output: pipelineArtifact
targetPath: $(System.DefaultWorkingDirectory)
artifactName: output
steps:
- checkout: self
clean: true
- task: CmdLine@2
displayName: Re-attach head
inputs:
script: |
git checkout --track "origin/${BUILD_SOURCEBRANCH//refs\/heads\/}"
git pull
- task: NodeTool@0
displayName: Use Node 16.x
inputs:
versionSpec: 16.x
# PUPPETEER_DOWNLOAD_BASE_URL=https://storage.googleapis.com/chrome-for-testing-public is a workaround for puppeteer
# as puppeteer versions <22.0.0 will cause npm install to hang in CI environments.
# see issue: https://github.com/puppeteer/puppeteer/issues/12833
- script: |
PUPPETEER_DOWNLOAD_BASE_URL=https://storage.googleapis.com/chrome-for-testing-public npm install
displayName: npm install
- task: CmdLine@2
displayName: Authenticate git for pushes
inputs:
script: >-
git config user.name "Tabster Build"
git config user.email "fluentui-internal@service.microsoft.com"
git remote set-url origin https://$(githubUser):$(githubPAT)@github.com/microsoft/tabster.git
- task: CmdLine@2
displayName: Write npmrc for publish token
inputs:
script: echo '//registry.npmjs.org/:_authToken=${NPM_TOKEN}' > .npmrc
condition: eq(variables.skipPublish, false)
- task: CmdLine@2
displayName: Publish (official)
condition: and(eq(variables.skipPublish, false), eq(variables.prerelease, false))
inputs:
script: 'npm run release -- $(publishVersion) --ci '
env:
NPM_TOKEN: $(npmToken)
- task: CmdLine@2
displayName: Publish (prerelease)
condition: and(eq(variables.skipPublish, false), eq(variables.prerelease, true))
inputs:
script: npm run release -- $(publishVersion) --preRelease $(prereleaseTag) --ci
env:
NPM_TOKEN: $(npmToken)