diff --git a/.github/workflows/covector-version-or-publish.yml b/.github/workflows/covector-version-or-publish.yml
index bd35188ea..1372c53ec 100644
--- a/.github/workflows/covector-version-or-publish.yml
+++ b/.github/workflows/covector-version-or-publish.yml
@@ -25,10 +25,10 @@ jobs:
- uses: actions/setup-node@v2
with:
node-version: 14
- registry-url: "https://registry.npmjs.org"
+ registry-url: 'https://registry.npmjs.org'
cache: yarn
cache-dependency-path: tooling/*/yarn.lock
-
+
- name: Cache CLI cargo target
uses: actions/cache@v2
with:
@@ -60,7 +60,7 @@ jobs:
CARGO_AUDIT_OPTIONS: ${{ secrets.CARGO_AUDIT_OPTIONS }}
with:
token: ${{ secrets.GITHUB_TOKEN }}
- command: "version-or-publish"
+ command: 'version-or-publish'
createRelease: true
- name: Create Pull Request With Versions Bumped
if: steps.covector.outputs.commandRan == 'version'
@@ -69,125 +69,14 @@ jobs:
token: ${{ secrets.GITHUB_TOKEN }}
branch: release/version-updates
title: Apply Version Updates From Current Changes
- commit-message: "apply version updates"
- labels: "version updates"
+ commit-message: 'apply version updates'
+ labels: 'version updates'
body: ${{ steps.covector.outputs.change }}
- update-docs:
- needs: version-or-publish
- if: needs.version-or-publish.outputs.successfulPublish == 'true'
- runs-on: ubuntu-latest
- steps:
- # Setup
- - name: checkout tauri
- uses: actions/checkout@v2
- with:
- path: tauri
- - name: checkout tauri-docs
- uses: actions/checkout@v2
- with:
- repository: tauri-apps/tauri-docs
- path: tauri-docs
- - name: checkout tauri-search-bot
- uses: actions/checkout@v2
- with:
- repository: tauri-apps/tauri-search-bot
- path: tauri-search-bot
- - name: install webkit2gtk
- run: |
- sudo apt-get update
- sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libappindicator3-dev librsvg2-dev patchelf
-
- # 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.0.3
- with:
- originPath: ./tauri/target/doc/
- targetPath: ./tauri-docs/docs/en/api/rust/
- sidebarPath: ./tauri-docs/sidebars/rustdoc.json
- linksRoot: ""
- cratesToProcess: "tauri"
-
- # TypeScript
- - name: run typedocusaurus
- uses: tauri-apps/typedocusaurus@v1
- with:
- originPath: ./tauri/tooling/api/
- sidebarFile: ./tauri-docs/sidebars/typedoc.json
- targetPath: ./tauri-docs/en/api/js/
- docusaurusPath: ./tauri-docs/
-
- # Moving docs for Indexation
- - name: copy docs
- working-directory: ./tauri
- run: |
- mv docs/sidebar.json ${{ github.workspace }}/tauri-docs/sidebars/core.json
- cp -r docs/!(.templates) ${{ github.workspace }}/tauri-docs/docs/en
- mv ARCHITECTURE.md ${{ github.workspace }}/tauri-docs/docs/en/about/architecture.md
-
- # Indexing
- - name: meilisearch indexation
- uses: tauri-apps/docusaurus-meilisearch-indexer@v1
- with:
- version: ${{ github.event.release.tag_name }}
- docusaurusPath: ./tauri-docs
- host: https://search.tauri.studio
- apiKey: ${{ secrets.MEILISEARCH_APIKEY }}
- docs: "Getting started,Usage,API"
-
- # Applying Version
- - name: set docs' Tauri version
- working-directory: ./tauri-docs
- run: echo ${{ github.event.release.tag_name }} > version.txt
- - name: set bot's Tauri version
- working-directory: ./tauri-search-bot
- run: echo ${{ github.event.release.tag_name }} > version.txt
-
- - uses: iamsauravsharma/create-dotenv@v1.1.0
- with:
- directory: "./tauri-search-bot"
- env:
- ENV_KEY_DISCORD_BOT_SECRET: ${{ secrets.DISCORD_BOT_SECRET }}
- ENV_KEY_PREFIX: \!
- ENV_KEY_SITE: tauri.studio
- ENV_KEY_ICON: https://i.imgur.com/UzDERvw.png
- ENV_KEY_LIMIT: 5
- ENV_KEY_SEARCH_INDEX: ${{ github.event.release.tag_name }}
- ENV_KEY_MEILISEARCH_PUBLIC_KEY: ea0105f56bb5a2111ed28c7a0c637fc0bed07273f571dc7cb1f73900e44f8e7f
-
- # Bot Deployment
- - name: scp bot
- uses: appleboy/scp-action@master
- with:
- host: ${{ secrets.DISCORD_BOT_HOST }}
- username: ${{ secrets.DISCORD_BOT_SSH_USER }}
- key: ${{ secrets.DISCORD_BOT_SSH_KEY }}
- source: "./tauri-search-bot"
- target: "~/tauri-search-bot"
- - name: restart the bot
- uses: appleboy/ssh-action@master
- with:
- host: ${{ secrets.DISCORD_BOT_HOST }}
- username: ${{ secrets.DISCORD_BOT_SSH_USER }}
- key: ${{ secrets.DISCORD_BOT_SSH_KEY }}
- script: cd ~/tauri-search-bot && yarn && forever stopall && forever start ./src/index.js
-
- # tauri-docs PR
- - name: git config
- run: |
- git config --global user.name "${{ github.event.pusher.name }}"
- git config --global user.email "${{ github.event.pusher.email }}"
- - name: create pull request for updated docs
- uses: tauri-apps/create-pull-request@v3.4.1
+ - name: Trigger doc update
+ if: steps.covector.outputs.successfulPublish == 'true'
+ uses: peter-evans/repository-dispatch@v1
with:
token: ${{ secrets.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.
+ repository: tauri-apps/tauri-docs
+ event-type: update-docs
diff --git a/.github/workflows/update-docs.yml b/.github/workflows/update-docs.yml
deleted file mode 100644
index 0c8fe520f..000000000
--- a/.github/workflows/update-docs.yml
+++ /dev/null
@@ -1,134 +0,0 @@
-# Copyright 2019-2021 Tauri Programme within The Commons Conservancy
-# SPDX-License-Identifier: Apache-2.0
-# SPDX-License-Identifier: MIT
-
-name: update-docs
-
-on:
- release:
- types: [published]
- workflow_dispatch:
- inputs:
- gitName:
- description: "git name for PR"
- required: false
- default: "tauri-bot"
- gitEmail:
- description: "git email for PR"
- required: false
- default: "tauri-bot@tauri.studio"
- version:
- description: "Tauri version"
- required: true
-
-jobs:
- update-docs:
- runs-on: ubuntu-latest
- steps:
- # Setup
- - name: checkout tauri
- uses: actions/checkout@v2
- with:
- path: tauri
- - name: checkout tauri-docs
- uses: actions/checkout@v2
- with:
- repository: tauri-apps/tauri-docs
- path: tauri-docs
- - name: checkout tauri-search-bot
- uses: actions/checkout@v2
- with:
- repository: tauri-apps/tauri-search-bot
- path: tauri-search-bot
-
- # 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 libgtk-3-dev webkit2gtk-4.0 libappindicator3-dev librsvg2-dev patchelf
-
- # # 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"
-
- - name: Generate JS docs
- working-directory: ./tauri/tooling/api
- run: yarn && yarn generate-docs
-
- - name: Copy JS docs
- run: cp -r tauri/tooling/api/docs/* tauri-docs/docs/api/js/
-
- # Indexing
- - name: meilisearch indexation
-
- uses: tauri-apps/docusaurus-meilisearch-indexer@v1
- with:
- version: ${{ github.event.inputs.version || github.event.release.tag_name }}
- docusaurusPath: "${{ github.workspace }}/tauri-docs"
- host: https://search.tauri.studio
- apiKey: ${{ secrets.MEILISEARCH_APIKEY }}
- docs: "Getting started,Usage,API"
-
- # Applying Version
- - name: set docs' Tauri version
- working-directory: ./tauri-docs
- run: echo ${{ github.event.inputs.version || github.event.release.tag_name }} > version.txt
- - name: set bot's Tauri version
- working-directory: ./tauri-search-bot
- run: echo ${{ github.event.inputs.version || github.event.release.tag_name }} > version.txt
-
- - uses: iamsauravsharma/create-dotenv@v1.1.0
- with:
- directory: './tauri-search-bot'
- env:
- ENV_KEY_DISCORD_BOT_SECRET: ${{ secrets.DISCORD_BOT_SECRET }}
- ENV_KEY_PREFIX: \!
- ENV_KEY_SITE: tauri.studio
- ENV_KEY_ICON: https://i.imgur.com/UzDERvw.png
- ENV_KEY_LIMIT: 5
- ENV_KEY_SEARCH_INDEX: ${{ github.event.release.tag_name }}
- ENV_KEY_MEILISEARCH_PUBLIC_KEY: ea0105f56bb5a2111ed28c7a0c637fc0bed07273f571dc7cb1f73900e44f8e7f
-
- # Bot Deployment
- - name: scp bot
- uses: appleboy/scp-action@master
- with:
- host: ${{ secrets.DISCORD_BOT_HOST }}
- username: ${{ secrets.DISCORD_BOT_SSH_USER }}
- key: ${{ secrets.DISCORD_BOT_SSH_KEY }}
- source: "${{ github.workspace }}/tauri-search-bot"
- target: "~/tauri-search-bot"
- - name: restart the bot
- uses: appleboy/ssh-action@master
- with:
- host: ${{ secrets.DISCORD_BOT_HOST }}
- username: ${{ secrets.DISCORD_BOT_SSH_USER }}
- key: ${{ secrets.DISCORD_BOT_SSH_KEY }}
- script: cd ~/tauri-search-bot/github/workspace/tauri-search-bot/ && yarn && forever stopall && forever start ./src/index.js
-
- # 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
- uses: tauri-apps/create-pull-request@v3.4.1
- with:
- token: ${{ secrets.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.
diff --git a/.scripts/covector/generate-cli-doc.js b/.scripts/covector/generate-cli-doc.js
deleted file mode 100644
index 9b1afbba0..000000000
--- a/.scripts/covector/generate-cli-doc.js
+++ /dev/null
@@ -1,26 +0,0 @@
-const childProcess = require('child_process')
-const path = require('path')
-const fs = require('fs')
-const rustCliPath = path.join(
- __dirname,
- '../../tooling/cli.rs/target/debug/cargo-tauri'
-)
-const templatePath = path.join(__dirname, '../../docs/.templates/cli.md')
-const targetPath = path.join(__dirname, '../../docs/api/cli.md')
-const template = fs.readFileSync(templatePath, 'utf8')
-
-const commands = ['info', 'init', 'plugin init', 'dev', 'build']
-
-let doc = template
-
-for (const cmd of commands) {
- const output = childProcess
- .execSync(`${rustCliPath} ${cmd} --help`)
- .toString()
- .split('\n')
- output.splice(0, 2)
- output.splice(-1)
- doc = doc.replace(`{${cmd}}`, '```\n' + output.join('\n') + '\n```')
-}
-
-fs.writeFileSync(targetPath, doc)
diff --git a/.scripts/covector/generate-config-doc.js b/.scripts/covector/generate-config-doc.js
deleted file mode 100644
index 6e2de5a25..000000000
--- a/.scripts/covector/generate-config-doc.js
+++ /dev/null
@@ -1,147 +0,0 @@
-const fs = require('fs')
-const path = require('path')
-const schema = JSON.parse(
- fs.readFileSync('tooling/cli.rs/schema.json').toString()
-)
-const templatePath = path.join(__dirname, '../../docs/.templates/config.md')
-const targetPath = path.join(__dirname, '../../docs/api/config.md')
-const template = fs.readFileSync(templatePath, 'utf8')
-
-function formatDescription(description) {
- return description
- ? description
- .replace(/`/g, '\\`')
- .replace(/\n/g, ' ')
- .replace(/ /g, ' ')
- .replace(/{/g, '\\{')
- .replace(/}/g, '\\}')
- : ''
-}
-
-function generatePropertiesEl(schema, anchorRoot, definition, tab) {
- const previousTabLevel = tab.replace(' ', '')
- const fields = [`anchorRoot="${anchorRoot}"`]
-
- if (definition.additionalProperties) {
- fields.push(`type="${definition.type}"`)
- fields.push(`description="${formatDescription(definition.description)}"`)
- }
-
- const rows = []
- for (const propertyName in definition.properties) {
- const property = definition.properties[propertyName]
- if ('type' in property) {
- let type
- if ('items' in property) {
- if (property.items.type) {
- type = `${property.items.type}[]`
- } else {
- const typeName = property.items.$ref.replace('#/definitions/', '')
- const propDefinition = schema.definitions[typeName]
- const propertyEl = generatePropertiesEl(
- schema,
- `${anchorRoot}.${propertyName}`,
- propDefinition,
- `${tab} `
- )
- rows.push({
- property: propertyName,
- optional: 'default' in property || property.type.includes('null'),
- type: `${typeName}[]`,
- description: property.description,
- child: `
-
-