2021-04-11 01:09:09 +03:00
|
|
|
# Copyright 2019-2021 Tauri Programme within The Commons Conservancy
|
|
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
# SPDX-License-Identifier: MIT
|
|
|
|
|
2020-07-19 23:50:56 +03:00
|
|
|
name: version or publish
|
2020-07-19 23:33:12 +03:00
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- dev
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
version-or-publish:
|
|
|
|
runs-on: ubuntu-latest
|
2020-11-10 17:46:23 +03:00
|
|
|
timeout-minutes: 65
|
2020-07-20 08:19:35 +03:00
|
|
|
outputs:
|
|
|
|
change: ${{ steps.covector.outputs.change }}
|
|
|
|
commandRan: ${{ steps.covector.outputs.commandRan }}
|
|
|
|
successfulPublish: ${{ steps.covector.outputs.successfulPublish }}
|
2020-07-19 23:33:12 +03:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
|
|
|
- uses: actions/setup-node@v1
|
|
|
|
with:
|
2020-11-10 17:46:23 +03:00
|
|
|
node-version: 14
|
2021-04-17 01:55:00 +03:00
|
|
|
registry-url: "https://registry.npmjs.org"
|
2020-07-19 23:33:12 +03:00
|
|
|
- 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 }}"
|
2020-07-20 08:35:13 +03:00
|
|
|
- name: covector version or publish (publish when no change files present)
|
2021-04-17 01:55:00 +03:00
|
|
|
uses: jbolda/covector/packages/action@feat/enable-prereleases
|
2020-07-19 23:33:12 +03:00
|
|
|
id: covector
|
2020-07-20 23:21:43 +03:00
|
|
|
env:
|
|
|
|
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
2020-11-10 16:59:04 +03:00
|
|
|
CARGO_AUDIT_OPTIONS: ${{ secrets.CARGO_AUDIT_OPTIONS }}
|
2020-07-19 23:33:12 +03:00
|
|
|
with:
|
2020-07-20 23:21:43 +03:00
|
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
2021-04-17 01:55:00 +03:00
|
|
|
command: "version-or-publish"
|
2020-07-20 07:34:16 +03:00
|
|
|
createRelease: true
|
2020-07-19 23:33:12 +03:00
|
|
|
- name: Create Pull Request With Versions Bumped
|
2020-07-23 05:00:28 +03:00
|
|
|
if: steps.covector.outputs.commandRan == 'version'
|
2020-11-10 09:53:57 +03:00
|
|
|
uses: tauri-apps/create-pull-request@v3.4.1
|
2020-07-19 23:33:12 +03:00
|
|
|
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 }}
|
|
|
|
|
2020-07-21 20:35:43 +03:00
|
|
|
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
|
2021-04-17 01:52:58 +03:00
|
|
|
working-directory: ./tauri/core/tauri
|
2020-07-21 20:35:43 +03:00
|
|
|
run: cargo doc --no-deps
|
|
|
|
- name: run rustdocusaurus
|
|
|
|
uses: tauri-apps/rustdocusaurus/github-action@v1
|
|
|
|
with:
|
|
|
|
originPath: ./tauri/target/doc/
|
2020-07-30 00:53:30 +03:00
|
|
|
targetPath: ./tauri-docs/docs/en/api/rust/
|
2020-07-21 20:35:43 +03:00
|
|
|
sidebarPath: ./tauri-docs/sidebars.json
|
|
|
|
linksRoot: /docs/api/rust/
|
2021-04-17 01:52:58 +03:00
|
|
|
cratesToProcess: "tauri,tauri_utils"
|
|
|
|
- name: run typedocusaurus
|
2021-04-19 20:53:38 +03:00
|
|
|
uses: tauri-apps/typedocusaurus@v1
|
2021-04-17 01:52:58 +03:00
|
|
|
with:
|
|
|
|
originPath: ./tauri/tooling/api/
|
|
|
|
sidebarFile: sidebars.json
|
|
|
|
targetPath: en/api/js
|
|
|
|
docusaurusPath: ./tauri-docs/
|
2020-07-21 20:35:43 +03:00
|
|
|
- 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
|
2020-11-10 09:53:57 +03:00
|
|
|
uses: tauri-apps/create-pull-request@v3.4.1
|
2020-07-21 20:35:43 +03:00
|
|
|
with:
|
|
|
|
token: ${{ secrets.TAURI_BOT_PAT }}
|
2021-04-17 01:52:58 +03:00
|
|
|
commit-message: "chore(docs): Update Rust & TS docs"
|
2020-07-21 20:35:43 +03:00
|
|
|
branch: docs/release
|
|
|
|
path: tauri-docs
|
|
|
|
title: Update Docs
|
|
|
|
labels: "new release"
|
|
|
|
body: |
|
|
|
|
These are the updated docs from the most recent release.
|