forked from tauri-apps/tauri-docs
-
Notifications
You must be signed in to change notification settings - Fork 0
139 lines (118 loc) · 4.52 KB
/
trigger-workflow.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
# Copyright 2019-2022 Tauri Programme within The Commons Conservancy
# SPDX-License-Identifier: Apache-2.0
# SPDX-License-Identifier: MIT
name: update-docs-modified
on:
repository_dispatch:
types: [dispatch-test]
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:
# Set a variable to handle the branch
CURRENT_BRANCH: "${{ github.event_name == 'workflow_dispatch' && github.event.inputs.tauriBranch || 'origin/1.x' }}"
steps:
- run: echo "$CURRENT_BRANCH"
- name: Checkout tauri
uses: actions/checkout@v3
with:
repository: vasfvitor/tauri
# here sets the branch
ref: ${{ github.env.CURRENT_BRANCH }}
# ref: ${{ github.event.client_payload.ref }}
path: tauri
- name: Checkout tauri-docs
uses: actions/checkout@v3
with:
repository: vasfvitor/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.