forked from microsoft/fluentui
-
Notifications
You must be signed in to change notification settings - Fork 2
/
azure-pipelines.release.yml
201 lines (169 loc) · 7.3 KB
/
azure-pipelines.release.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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
pr: none
trigger: none
# Customize build number to include major version
# Example: v8_20201022.1
name: 'v8_$(Date:yyyyMMdd)$(Rev:.r)'
variables:
- group: 'Github and NPM secrets'
- template: .devops/templates/variables.yml
parameters:
skipComponentGovernanceDetection: false
- group: InfoSec-SecurityResults
- name: tags
value: production,externalfacing
schedules:
# minute 0, hour 7 in UTC (11pm in UTC-8), any day of month, any month, days 1-5 of week (M-F)
# https://docs.microsoft.com/en-us/azure/devops/pipelines/build/triggers?tabs=yaml&view=azure-devops#supported-cron-syntax
- cron: '0 7 * * 1-5'
# will be 12am during daylight savings time unless trigger is updated
displayName: 'Daily release (Sundary-Thursday at 11pm PST)'
branches:
include:
- master
jobs:
- template: .devops/templates/compliance-job.yml
- job: Release
dependsOn: Compliance
pool: '1ES-Host-Ubuntu'
workspace:
clean: all
steps:
- template: .devops/templates/tools.yml
- script: |
git config user.name "Fluent UI Build"
git config user.email "fluentui-internal@service.microsoft.com"
git remote set-url origin https://$(githubUser):$(githubPAT)@github.com/microsoft/fluentui.git
displayName: Authenticate git for pushes
- task: Bash@3
inputs:
filePath: yarn-ci.sh
displayName: yarn
- script: |
yarn generate-version-files
displayName: Generate version files
- script: |
yarn run:published build --production
displayName: yarn build
# --only makes it only run tests (otherwise due to the missing --production arg, lage would re-run the build)
# https://github.com/microsoft/fluentui/issues/21686
- script: |
yarn run:published test --only
displayName: yarn [test]
- script: |
yarn run:published lint --only
displayName: yarn lint
- script: |
yarn run:published bundle --only --production
displayName: yarn bundle
- script: |
yarn publish:beachball -n $(npmToken) --config scripts/beachball/release-v8.config.js
git reset --hard origin/master
env:
GITHUB_PAT: $(githubPAT)
displayName: Publish changes and bump versions
- script: |
echo Making $(Build.ArtifactStagingDirectory)/api
mkdir -p $(Build.ArtifactStagingDirectory)/api
cp packages/*/dist/*.api.json $(Build.ArtifactStagingDirectory)/api
displayName: Copy api.json files to artifact staging directory
- task: PublishBuildArtifacts@1
inputs:
pathtoPublish: $(Build.ArtifactStagingDirectory)/api
artifactName: 'api-json'
publishLocation: 'Container'
displayName: 'Publish artifact: api-json'
- task: PublishBuildArtifacts@1
inputs:
pathtoPublish: apps/public-docsite/dist
artifactName: 'fabric-website'
publishLocation: 'Container'
displayName: 'Publish artifact: fabric-website (public-docsite)'
- task: PublishBuildArtifacts@1
inputs:
pathtoPublish: packages/react/dist
artifactName: 'fabric'
publishLocation: 'Container'
displayName: 'Publish artifact: fabric (packages/react/dist)'
- script: |
oufrVersion=$(node -p -e "require('./packages/react/package.json').version")
echo "OUFR Version: $oufrVersion"
echo $oufrVersion > oufr-version.txt
echo "##vso[task.setvariable variable=oufrVersion;]$oufrVersion"
displayName: 'Set oufrVersion variable'
- task: PublishBuildArtifacts@1
inputs:
pathtoPublish: ./oufr-version.txt
artifactName: 'oufr-version'
publishLocation: 'Container'
displayName: 'Publish artifact: oufr-version'
# create-site-manifests is a script defined in @fluentui/public-docsite-setup.
# It generates manifest files used to load the current version on developer.microsoft.com/fluentui.
- script: |
yarn create-site-manifests ./packages/react
displayName: 'Generate website manifests'
- task: PublishBuildArtifacts@1
inputs:
pathtoPublish: ./site-manifests
artifactName: 'fabric-website-manifests'
publishLocation: 'Container'
displayName: 'Publish artifact: fabric-website-manifests'
- task: PublishBuildArtifacts@1
inputs:
pathtoPublish: apps/public-docsite-resources/dist/demo
artifactName: 'fabric-website-resources'
publishLocation: 'Container'
displayName: 'Publish artifact: fabric-website-resources (public-docsite-resources)'
# Generate the homepage.htm file used to load developer.microsoft.com/fluentui. Note that the
# generated file must be manually checked in to an internal repo, it's just generated as a build
# artifact for convenience and tracking.
- script: |
node ./packages/public-docsite-setup/scripts/generateHomepage ./homepage
displayName: 'Generate homepage.htm'
- task: PublishBuildArtifacts@1
inputs:
# This includes the actual homepage.htm as well as a non-minified JS file for debugging
pathtoPublish: ./homepage
artifactName: 'homepage.htm'
publishLocation: 'Container'
displayName: 'Publish artifact: homepage.htm'
- script: |
node ./scripts/generators/generate-package-manifest
displayName: 'Generate package manifest'
- task: PublishBuildArtifacts@1
inputs:
pathtoPublish: package-manifest
artifactName: 'package-manifest'
publishLocation: 'Container'
displayName: 'Publish artifact: package-manifest'
- task: PublishBuildArtifacts@1
inputs:
pathtoPublish: packages/fluentui/docs/src/public
artifactName: 'demo-images'
publishLocation: 'Container'
displayName: 'Publish artifact: demo-images'
# Run this near the end because it's more likely to fail than the artifact upload tasks, and its
# failure doesn't need to block anything else
- script: |
node -r ./scripts/ts-node/register ./scripts/update-release-notes/index.ts --token=$(githubPAT) --apply --debug
displayName: 'Update github release notes'
- task: AzureArtifacts.manifest-generator-task.manifest-generator-task.ManifestGeneratorTask@0
displayName: 📒 Generate Manifest
inputs:
BuildDropPath: $(System.DefaultWorkingDirectory)
- task: PublishPipelineArtifact@1
displayName: 📒 Publish Manifest
inputs:
artifactName: SBom-$(System.JobAttempt)
targetPath: $(System.DefaultWorkingDirectory)/_manifest
# This would usually be run automatically (via a pipeline decorator from an extension), but the
# thorough cleanup step prevents it from working. So run it manually here.
- task: ComponentGovernanceComponentDetection@0
displayName: 'Component governance detection'
inputs:
sourceScanPath: $(Agent.BuildDirectory)
condition: succeeded()
timeoutInMinutes: 5
continueOnError: true
- template: .devops/templates/cleanup.yml
parameters:
checkForModifiedFiles: false