forked from microsoft/fluentui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathazure-pipelines.release.yml
180 lines (150 loc) · 5.73 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
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:
azureSubscription: 'UI Fabric (private)'
skipComponentGovernanceDetection: false
pool: 'Self Host Ubuntu'
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
workspace:
clean: all
steps:
- template: .devops/templates/tools.yml
- script: |
git config user.name "Fluent UI Build"
git config user.email "[email protected]"
git remote set-url origin https://$(githubUser):$(githubPAT)@github.com/microsoft/fluentui.git
displayName: Authenticate git for pushes
# This step has no dependencies, so do it early in the build in case other steps fail
- task: AzureUpload@2
displayName: Upload demo images
inputs:
azureSubscription: $(azureSubscription)
BlobPrefix: 'assets'
CacheControl: 'public, max-age=600000'
ContainerName: 'fabric-website' # this container has a CDN
SourcePath: 'packages/fluentui/docs/src/public'
storage: fabricweb
- 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 --no-cache
displayName: yarn build
# test, lint, bundle using lage cached build from previous step (omit --no-cache)
- script: |
yarn run:published test --production
displayName: yarn test
- script: |
yarn run:published lint
displayName: yarn lint
- script: |
yarn run:published bundle --production
displayName: yarn bundle
- 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'
- task: PublishBuildArtifacts@1
inputs:
pathtoPublish: apps/public-docsite/index.html
artifactName: 'fabric-website-index'
publishLocation: 'Container'
displayName: 'Publish Artifact: Fabric Website index.html'
- task: PublishBuildArtifacts@1
inputs:
pathtoPublish: packages/react/dist
artifactName: 'fabric'
publishLocation: 'Container'
displayName: 'Publish Artifact: Fabric'
- script: |
npm run publish:beachball -- -b origin/master -n $(npmToken) --access public -y &&
git reset --hard origin/master
env:
GITHUB_PAT: $(githubPAT)
displayName: 'Publish Change Requests and Bump Versions'
- script: |
node -r ./scripts/ts-node-register ./scripts/updateReleaseNotes/index.ts --token=$(githubPAT) --apply --debug
displayName: 'Update github release notes'
- 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 OUFR Version Task Variable'
- task: PublishBuildArtifacts@1
inputs:
pathtoPublish: ./oufr-version.txt
artifactName: 'oufr-version'
publishLocation: 'Container'
displayName: 'Publish Artifact: oufr-version.txt'
- script: |
npm run create-public-flight-config -- --baseCDNUrl https://fabricweb.azureedge.net/fabric-website/$(Build.BuildNumber)/
workingDirectory: apps/public-docsite
displayName: 'Generate Fabric Website Flight Manifest Files'
- task: PublishBuildArtifacts@1
inputs:
pathtoPublish: apps/public-docsite/flights
artifactName: 'fabric-website-manifests'
publishLocation: 'Container'
displayName: 'Publish Artifact: 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'
- script: |
node ./scripts/generate-package-manifest
displayName: 'Generates a package manifest'
- task: AzureUpload@2
displayName: Upload Package Manifest
inputs:
SourcePath: 'package-manifest'
azureSubscription: $(azureSubscription)
storage: fabricweb
ContainerName: 'fabric'
BlobPrefix: 'package-manifest'
Gzip: false
# 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 Detection'
inputs:
sourceScanPath: $(Agent.BuildDirectory)
condition: succeeded()
timeoutInMinutes: 5
continueOnError: true
- template: .devops/templates/cleanup.yml
parameters:
checkForChangedFiles: false