-
-
Notifications
You must be signed in to change notification settings - Fork 32
57 lines (52 loc) · 1.99 KB
/
Copy pathupdate-api-docs.yml
File metadata and controls
57 lines (52 loc) · 1.99 KB
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
name: update-api-docs
# Regenerates content/api when a new @nativescript/core version is released.
#
# Triggered by a repository_dispatch sent from NativeScript/NativeScript when
# a core release tag (e.g. "9.0.21-core") is pushed — see the
# notify_docs_core_release.yml workflow in that repo. Can also be run
# manually for any published version.
on:
repository_dispatch:
types: [core-release]
workflow_dispatch:
inputs:
version:
description: '@nativescript/core version to generate docs for'
required: false
default: 'latest'
# Needed by peter-evans/create-pull-request (push branch + open PR)
permissions:
contents: write
pull-requests: write
jobs:
regenerate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 22.14.0
- name: Resolve target version
run: |
VERSION="${{ github.event.client_payload.version || inputs.version || 'latest' }}"
echo "CORE_VERSION=$VERSION" >> "$GITHUB_ENV"
- name: Install dependencies
run: yarn
- name: Update @nativescript/core
run: yarn add -D @nativescript/core@$CORE_VERSION
- name: Regenerate API reference
run: yarn generate:api-docs
env:
# Used for the GitHub tree lookup that validates "Defined in" source links
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Open PR if the API changed
uses: peter-evans/create-pull-request@v6
with:
commit-message: 'chore(api): regenerate API reference for @nativescript/core@${{ env.CORE_VERSION }}'
title: 'chore(api): regenerate API reference (@nativescript/core@${{ env.CORE_VERSION }})'
body: |
Automated regeneration of `content/api` for `@nativescript/core@${{ env.CORE_VERSION }}`.
Generated with `yarn generate:api-docs`.
branch: chore/update-api-docs
delete-branch: true