-
Notifications
You must be signed in to change notification settings - Fork 72
75 lines (59 loc) · 2.09 KB
/
build-typescript-docs.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
name: Build TypeScript docs
on:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: "16.x"
- name: get latest d.ts
working-directory: ./config
run: wget https://raw.githubusercontent.com/obsidianmd/obsidian-api/master/obsidian.d.ts
- name: Clone rushstack fork
run: git clone https://github.com/joethei/rushstack.git
- name: Install Rush
run: npm install -g @microsoft/rush
- name: Build Rushstack
working-directory: ./rushstack
continue-on-error: true
run: |
rush update --bypass-policy
rush build
- name: Run API Extractor
run: |
cd config
../rushstack/apps/api-extractor/bin/api-extractor run --local --verbose
- name: Pre-Process API Extractor output
working-directory: ./config
run: node pre-process.js
- name: Generate API docs
working-directory: ./config
run: ../rushstack/apps/api-documenter/bin/api-documenter generate --output ../en/Reference/TypeScript\ API
- name: Post-process Markdown
working-directory: ./config
run: node post-process.js
- name: Print changes
run: git diff
- name: Configure Git user
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
- name: Commit and push changes
run: |
git checkout -b $GITHUB_RUN_ID
git add en/Reference
git commit -m "Auto-generate docs for obsidian.d.ts"
git push -u origin $GITHUB_RUN_ID
- name: Create pull request
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh pr create \
--title "Auto-generate docs for obsidian.d.ts" \
--body "This PR has been automatically created by GitHub Actions." \
--base main \
--head $GITHUB_RUN_ID