forked from tauri-apps/tauri-docs
-
Notifications
You must be signed in to change notification settings - Fork 0
143 lines (122 loc) · 4.59 KB
/
update-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
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
# Copyright 2019-2022 Tauri Programme within The Commons Conservancy
# SPDX-License-Identifier: Apache-2.0
# SPDX-License-Identifier: MIT
name: update-docs
on:
push:
branches:
- dev
pull_request:
repository_dispatch:
types: [update-docs, test-update-docs]
workflow_dispatch:
inputs:
gitName:
description: 'git name for PR'
required: false
default: 'tauri-bot'
gitEmail:
description: 'git email for PR'
required: false
default: '[email protected]'
tauriBranch:
description: 'tauri branch to pull'
required: false
jobs:
update-docs:
runs-on: ubuntu-latest
env:
CARGO_INCREMENTAL: 0 # This is set to 0 by the rust cache action, but better safe than sorry.
CARGO_PROFILE_DEV_DEBUG: 0 # This would add unnecessary bloat to the target folder, decreasing cache efficiency.
RUST_BACKTRACE: short
CURRENT_BRANCH: "${{ github.event_name == 'workflow_dispatch' && github.event.inputs.tauriBranch || '1.x' }}"
steps:
# Setup
- name: Checkout tauri
uses: actions/checkout@v3
with:
repository: tauri-apps/tauri
ref: ${{ github.env.CURRENT_BRANCH }}
path: tauri
- name: Checkout tauri-docs
uses: actions/checkout@v3
with:
repository: tauri-apps/tauri-docs
path: tauri-docs
submodules: true
- name: Update submodules
working-directory: ./tauri-docs
run: git submodule update --remote
- name: Build typedoc-plugin-markdown
working-directory: ./tauri-docs/packages/typedoc-plugin-markdown
run: |
npm install
cd packages/typedoc-plugin-markdown/
yarn build
- name: Prep for JS doc generation
working-directory: ./tauri/tooling/api
run: yarn
- name: Cleanup JS Docs
run: rm -rf tauri-docs/docs/api/js/*
- name: Build JS docs
working-directory: ./tauri-docs/packages/js-doc-generator
run: yarn && yarn generate-docs
# Any Rust documentation is currently disabled while we're falling back to docs.rs
#- name: install webkit2gtk
# run: |
# sudo apt-get update
# sudo apt-get install -y webkit2gtk-4.0 libappindicator3-dev
# # Rust
# - name: generate rust docs
# working-directory: ./tauri/core/tauri
# run: cargo doc --no-deps
# - name: run rustdocusaurus
# uses: tauri-apps/rustdocusaurus/github-action@v1
# with:
# originPath: ./tauri/target/doc/
# targetPath: ./tauri-docs/docs/en/api/rust/
# sidebarPath: "${{ github.workspace }}/tauri-docs/sidebars/rustdoc.json"
# linksRoot: ""
# cratesToProcess: "tauri"
- uses: dtolnay/rust-toolchain@stable
with:
components: rust-docs
- uses: Swatinem/rust-cache@v2
with:
workspaces: tauri/tooling/cli
- name: Build tauri-cli
run: cargo build --manifest-path ./tauri/tooling/cli/Cargo.toml
- name: Install dependencies
working-directory: ./tauri-docs
run: yarn
- name: Generate cli and config docs
run: |
node tauri-docs/.scripts/generate-cli-doc.js
node tauri-docs/.scripts/generate-config-doc.js
#- name: Generate tauri AST
# uses: actions-rs/cargo@v1
# with:
# command: doc
# args: --no-deps --manifest-path ./tauri/core/tauri/Cargo.toml --no-default-features --features "wry __isolation-docs custom-protocol api-all cli __updater-docs system-tray devtools dox"
# env:
# RUSTDOCFLAGS: '-Z unstable-options --output-format json'
#- name: Copy tauri.json
# run: cp tauri/target/doc/tauri.json tauri-docs/docs/api/rust/
# tauri-docs PR
- name: Git config
run: |
git config --global user.name "${{ github.event.inputs.gitName }}"
git config --global user.email "${{ github.event.inputs.gitEmail }}"
- name: Create pull request for updated docs
# soft fork of https://github.com/peter-evans/create-pull-request for security purposes
uses: tauri-apps/[email protected]
if: github.event_name != 'pull_request' && github.event_name != 'push'
with:
token: ${{ secrets.ORG_TAURI_BOT_PAT }}
commit-message: 'chore(docs): Update Rust & TS docs'
branch: docs/release
path: tauri-docs
title: Update Docs
labels: 'new release'
body: |
These are the updated docs from the most recent release.