forked from microsoft/fluentui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.release.yml
175 lines (153 loc) · 7.75 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
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
- name: tags
value: production,externalfacing
# below are variables configurable at queue time, so they cannot appear in yml file
# - name: skipPublish # set it to true in order to skip publishing to NPM. Useful for deploying docsite only updates.
# value: false
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
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
timeoutInMinutes: 90
workspace:
clean: all
templateContext:
outputParentDirectory: $(System.DefaultWorkingDirectory)
outputs:
- output: pipelineArtifact
targetPath: $(System.DefaultWorkingDirectory)/homepage
artifactName: homepage.htm
displayName: homepage.htm
- output: pipelineArtifact
targetPath: $(System.DefaultWorkingDirectory)/packages/fluentui/docs/src/public
artifactName: demo-images
displayName: demo-images
- output: pipelineArtifact
targetPath: $(System.DefaultWorkingDirectory)/oufr-version.txt
artifactName: oufr-version
displayName: oufr-version
- output: pipelineArtifact
targetPath: $(System.DefaultWorkingDirectory)/site-manifests
artifactName: fabric-website-manifests
displayName: fabric-website-manifests
- output: pipelineArtifact
targetPath: $(System.DefaultWorkingDirectory)/apps/public-docsite-resources/dist/demo
artifactName: fabric-website-resources
displayName: fabric-website-resources
- output: pipelineArtifact
targetPath: $(System.DefaultWorkingDirectory)/apps/public-docsite/dist
artifactName: fabric-website
displayName: fabric-website
- output: pipelineArtifact
targetPath: $(System.DefaultWorkingDirectory)/packages/react/dist
artifactName: fabric
displayName: fabric
- output: pipelineArtifact
targetPath: $(Build.ArtifactStagingDirectory)/api
artifactName: api-json
displayName: api-json
steps:
- template: .devops/templates/tools.yml@self
- 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
- task: Bash@3
inputs:
filePath: yarn-ci.sh
displayName: yarn
- script: |
yarn generate-version-files
displayName: Generate version files
- script: |
FLUENT_PROD_BUILD=true yarn nx run-many -t build -p tag:v8 --exclude tag:vNext,tag:tools,ssr-tests,vr-tests,perf-test --nxBail
displayName: build
- script: |
FLUENT_PROD_BUILD=true yarn nx run-many -t test -p tag:v8 --exclude tag:vNext,tag:tools,ssr-tests,vr-tests,perf-test --nxBail
displayName: test
- script: |
FLUENT_PROD_BUILD=true yarn nx run-many -t lint -p tag:v8 --exclude tag:vNext,tag:tools,ssr-tests,vr-tests,perf-test --nxBail
displayName: lint
- script: |
FLUENT_PROD_BUILD=true yarn nx run-many -t bundle -p tag:v8 --exclude tag:vNext,tag:tools,ssr-tests,vr-tests,perf-test --nxBail
displayName: bundle
- script: |
FLUENT_PROD_BUILD=true yarn nx run-many -t verify-packaging -p tag:v8 --exclude tag:vNext,tag:tools,ssr-tests,vr-tests,perf-test --nxBail
displayName: verify packaged assets
- script: |
yarn publish:beachball -n $(npmToken) --config scripts/beachball/src/release-v8.config.js --message 'release: applying package updates - react v8'
git reset --hard origin/master
condition: eq(variables.skipPublish, false)
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
- 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'
# 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'
# 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'
- template: .devops/templates/publish-website.yml@self
parameters:
version: 8
# 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/src/register ./scripts/update-release-notes/src/index.ts --token=$(githubPAT) --apply --debug
condition: eq(variables.skipPublish, false)
displayName: 'Update github release notes'
- template: .devops/templates/cleanup.yml@self
parameters:
checkForModifiedFiles: false