-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
132 lines (125 loc) · 4.72 KB
/
covector-version-or-publish.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
# 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@covector-v0
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: 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_api,tauri_utils"
- 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 docs"
branch: docs/release
path: tauri-docs
title: Update Docs
labels: "new release"
body: |
These are the updated docs from the most recent release.
tangle:
runs-on: ubuntu-latest
needs: version-or-publish
if: needs.version-or-publish.outputs.successfulPublish == 'true'
strategy:
fail-fast: false
matrix:
package:
- name: tauri.js
registryName: tauri
- name: tauri-bundler
registryName: tauri-bundler
- name: tauri-utils
registryName: tauri-utils
- name: tauri-core
registryName: tauri
steps:
- uses: actions/checkout@v2
- run: echo "PUBLISHED=$(jq '.${{ matrix.package.name }}.command' ${{ needs.version-or-publish.outputs.change }})" >> $GITHUB_ENV
- run: echo "PACKAGE_VERSION=$(jq '.${{ matrix.package.name }}.pkg.pkgFile.version' ${{ needs.version-or-publish.outputs.change }})" >> $GITHUB_ENV
- name: Tangle Release
if: env.PUBLISHED != 'false' && startsWith(env.PUBLISHED, 'parse error') != true && startsWith(env.PACKAGE_VERSION, 'parse error') != true
id: tangle_release
uses: iotaledger/gh-tangle-release@v0.6.2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
IOTA_SEED: ${{ secrets.IOTA_SEED }}
IOTA_NODE: "https://iotanode.us:14267"
with:
tag_name: ${{ matrix.package.name }}-v${{ env.PACKAGE_VERSION }}
comment: "Release ${{ matrix.package.name }} v${{ env.PACKAGE_VERSION }}"