mirror of
https://github.com/tauri-apps/tauri.git
synced 2024-12-16 23:22:26 +03:00
107 lines
3.6 KiB
YAML
107 lines
3.6 KiB
YAML
# Copyright 2019-2021 Tauri Programme within The Commons Conservancy
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
# SPDX-License-Identifier: MIT
|
|
|
|
name: version or publish
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- dev
|
|
|
|
jobs:
|
|
version-or-publish:
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 65
|
|
outputs:
|
|
change: ${{ steps.covector.outputs.change }}
|
|
commandRan: ${{ steps.covector.outputs.commandRan }}
|
|
successfulPublish: ${{ steps.covector.outputs.successfulPublish }}
|
|
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
with:
|
|
fetch-depth: 0
|
|
- uses: actions/setup-node@v1
|
|
with:
|
|
node-version: 14
|
|
registry-url: "https://registry.npmjs.org"
|
|
- name: cargo login
|
|
run: cargo login ${{ secrets.crate_token }}
|
|
- name: git config
|
|
run: |
|
|
git config --global user.name "${{ github.event.pusher.name }}"
|
|
git config --global user.email "${{ github.event.pusher.email }}"
|
|
- name: covector version or publish (publish when no change files present)
|
|
uses: jbolda/covector/packages/action@feat/enable-prereleases
|
|
id: covector
|
|
env:
|
|
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
CARGO_AUDIT_OPTIONS: ${{ secrets.CARGO_AUDIT_OPTIONS }}
|
|
with:
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
command: "version-or-publish"
|
|
createRelease: true
|
|
- name: Create Pull Request With Versions Bumped
|
|
if: steps.covector.outputs.commandRan == 'version'
|
|
uses: tauri-apps/create-pull-request@v3.4.1
|
|
with:
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
branch: release/version-updates
|
|
title: Apply Version Updates From Current Changes
|
|
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:
|
|
- 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: install webkit2gtk
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y webkit2gtk-4.0
|
|
- 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: ./tauri-docs/sidebars.json
|
|
linksRoot: /docs/api/rust/
|
|
cratesToProcess: "tauri,tauri_utils"
|
|
- name: run typedocusaurus
|
|
uses: tauri-apps/typedocusaurus@v1
|
|
with:
|
|
originPath: ./tauri/tooling/api/
|
|
sidebarFile: sidebars.json
|
|
targetPath: en/api/js
|
|
docusaurusPath: ./tauri-docs/
|
|
- 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
|
|
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.
|