@@ -27,11 +27,6 @@ resources:
2727 type : git
2828 name : 1ESPipelineTemplates/1ESPipelineTemplates
2929 ref : refs/tags/release
30- - repository : rushstackWebsites
31- type : github
32- name : microsoft/rushstack-websites
33- endpoint : pipelinesMicrosoftRushstack
34- ref : refs/heads/main
3530
3631extends :
3732 template : v1/1ES.Official.PipelineTemplate.yml@1esPipelines
@@ -113,88 +108,3 @@ extends:
113108 BranchName : $(BranchName)
114109 PrTitle : $(CommitMessage)
115110 PrDescription : ' Automated PR to bump decoupled local dependencies to the latest published versions.'
116-
117- # ──────────────────────────────────────────────────────────────────────────
118- # Stage 2: Update API documentation on rushstack-websites
119- # ──────────────────────────────────────────────────────────────────────────
120- - stage : UpdateApiDocs
121- displayName : ' Update API documentation'
122- dependsOn : [] # Run in parallel with BumpDecoupledDeps
123- variables :
124- BranchName : ' automated/update-api-docs'
125- CommitMessage : ' docs: update API documentation'
126- jobs :
127- - job :
128- pool :
129- name : publish-rushstack
130- os : linux
131- steps :
132- # Check out both repos. AzDO places them in subdirectories named after the
133- # repo alias when multiple checkouts are used:
134- # $(Pipeline.Workspace)/s/self (rushstack)
135- # $(Pipeline.Workspace)/s/rushstackWebsites (rushstack-websites)
136- - checkout : self
137- persistCredentials : true
138-
139- - checkout : rushstackWebsites
140- persistCredentials : true
141-
142- - template : /common/config/azure-pipelines/templates/install-node.yaml@self
143-
144- # Download the api artifact from the triggering publish pipeline.
145- # AzDO automatically resolves which pipeline resource triggered this run.
146- - task : DownloadPipelineArtifact@2
147- displayName : ' Download API review files'
148- inputs :
149- artifact : api
150- path : $(Pipeline.Workspace)/api
151-
152- # Install and build only api-documenter, which is needed to generate
153- # the markdown output from the *.api.json files.
154- - script : ' node common/scripts/install-run-rush.js install'
155- displayName : ' Rush Install'
156- workingDirectory : $(Pipeline.Workspace)/s/self
157-
158- - script : ' node common/scripts/install-run-rush.js build --to @microsoft/api-documenter --verbose'
159- displayName : ' Rush Build (api-documenter)'
160- workingDirectory : $(Pipeline.Workspace)/s/self
161-
162- # Run api-documenter to generate markdown files from the *.api.json inputs.
163- - script : ' node apps/api-documenter/bin/api-documenter markdown --input-folder $(Pipeline.Workspace)/api --output-folder $(Pipeline.Workspace)/api-markdown'
164- displayName : ' Generate API markdown'
165- workingDirectory : $(Pipeline.Workspace)/s/self
166-
167- # Update the API docs folder in rushstack-websites and commit.
168- - bash : |
169- set -e
170-
171- git config --local user.email rushbot@users.noreply.github.com
172- git config --local user.name Rushbot
173-
174- # Clear the existing pages and replace with freshly generated markdown.
175- API_DOCS_DIR="websites/api.rushstack.io/docs/pages"
176- rm -rf "$API_DOCS_DIR"
177- mkdir -p "$API_DOCS_DIR"
178- cp -r "$(Pipeline.Workspace)/api-markdown/." "$API_DOCS_DIR/"
179-
180- # Check for changes (tracked and untracked)
181- if git diff --quiet && [ -z "$(git ls-files --others --exclude-standard)" ]; then
182- echo "No API documentation changes detected."
183- echo "##vso[task.setvariable variable=HasChanges]false"
184- exit 0
185- fi
186-
187- echo "##vso[task.setvariable variable=HasChanges]true"
188-
189- git checkout -B $(BranchName)
190- git add --all
191- git commit -m "$(CommitMessage)"
192- displayName: 'Update API docs and commit'
193- workingDirectory: $(Pipeline.Workspace)/s/rushstackWebsites
194-
195- - template : /common/config/azure-pipelines/templates/push-and-create-github-pr.yaml@self
196- parameters :
197- BranchName : $(BranchName)
198- PrTitle : $(CommitMessage)
199- PrDescription : ' Automated PR to update API reference documentation from the latest published packages.'
200- WorkingDirectory : $(Pipeline.Workspace)/s/rushstackWebsites
0 commit comments