Skip to content

Commit b8a64d0

Browse files
committed
fix(cli): add prepublish scripts to the plugin templates
1 parent 07f9079 commit b8a64d0

File tree

5 files changed

+81
-1
lines changed

5 files changed

+81
-1
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"cli.rs": patch
3+
"cli.js": patch
4+
---
5+
6+
Fixes the covector configuration on the plugin templates.

tooling/cli/templates/plugin/backend/.changes/config.json

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,36 @@
44
"rust": {
55
"version": true,
66
"getPublishedVersion": "cargo search ${ pkg.pkg } --limit 1 | sed -nE 's/^[^\"]*\"//; s/\".*//1p' -",
7+
"prepublish": [
8+
"sudo apt-get update",
9+
"sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0",
10+
"cargo install cargo-audit",
11+
{
12+
"command": "cargo generate-lockfile",
13+
"dryRunCommand": true,
14+
"pipe": true
15+
},
16+
{
17+
"command": "echo \"# Cargo Audit\"",
18+
"dryRunCommand": true,
19+
"pipe": true
20+
},
21+
{
22+
"command": "echo '```'",
23+
"dryRunCommand": true,
24+
"pipe": true
25+
},
26+
{
27+
"command": "cargo audit ${ process.env.CARGO_AUDIT_OPTIONS || '' }",
28+
"dryRunCommand": true,
29+
"pipe": true
30+
},
31+
{
32+
"command": "echo '```'",
33+
"dryRunCommand": true,
34+
"pipe": true
35+
}
36+
],
737
"publish": [
838
{
939
"command": "cargo package --allow-dirty",

tooling/cli/templates/plugin/backend/.github/workflows/covector-version-or-publish.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,23 @@ jobs:
1717
with:
1818
node-version: 12
1919
registry-url: 'https://registry.npmjs.org'
20+
21+
- name: cargo login
22+
run: cargo login ${{ secrets.CRATE_TOKEN }}
23+
2024
- name: git config
2125
run: |
2226
git config --global user.name "${{ github.event.pusher.name }}"
2327
git config --global user.email "${{ github.event.pusher.email }}"
28+
2429
- name: covector version-or-publish
2530
uses: jbolda/covector/packages/action@covector-v0
2631
id: covector
2732
with:
2833
token: ${{ secrets.GITHUB_TOKEN }}
2934
command: 'version-or-publish'
3035
createRelease: true
36+
3137
- name: Create Pull Request With Versions Bumped
3238
if: steps.covector.outputs.commandRan == 'version'
3339
uses: tauri-apps/create-pull-request@v3.4.1

tooling/cli/templates/plugin/with-api/.changes/config.json

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,36 @@
44
"rust": {
55
"version": true,
66
"getPublishedVersion": "cargo search ${ pkg.pkg } --limit 1 | sed -nE 's/^[^\"]*\"//; s/\".*//1p' -",
7+
"prepublish": [
8+
"sudo apt-get update",
9+
"sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0",
10+
"cargo install cargo-audit",
11+
{
12+
"command": "cargo generate-lockfile",
13+
"dryRunCommand": true,
14+
"pipe": true
15+
},
16+
{
17+
"command": "echo \"# Cargo Audit\"",
18+
"dryRunCommand": true,
19+
"pipe": true
20+
},
21+
{
22+
"command": "echo '```'",
23+
"dryRunCommand": true,
24+
"pipe": true
25+
},
26+
{
27+
"command": "cargo audit ${ process.env.CARGO_AUDIT_OPTIONS || '' }",
28+
"dryRunCommand": true,
29+
"pipe": true
30+
},
31+
{
32+
"command": "echo '```'",
33+
"dryRunCommand": true,
34+
"pipe": true
35+
}
36+
],
737
"publish": [
838
{
939
"command": "cargo package --allow-dirty",
@@ -66,7 +96,9 @@
6696
"tauri-plugin-{{ plugin_name }}-api": {
6797
"path": ".",
6898
"manager": "javascript",
69-
"dependencies": ["tauri-plugin-{{ plugin_name }}"]
99+
"dependencies": [
100+
"tauri-plugin-{{ plugin_name }}"
101+
]
70102
}
71103
}
72104
}

tooling/cli/templates/plugin/with-api/.github/workflows/covector-version-or-publish.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,23 @@ jobs:
1717
with:
1818
node-version: 12
1919
registry-url: 'https://registry.npmjs.org'
20+
21+
- name: cargo login
22+
run: cargo login ${{ secrets.CRATE_TOKEN }}
23+
2024
- name: git config
2125
run: |
2226
git config --global user.name "${{ github.event.pusher.name }}"
2327
git config --global user.email "${{ github.event.pusher.email }}"
28+
2429
- name: covector version-or-publish
2530
uses: jbolda/covector/packages/action@covector-v0
2631
id: covector
2732
with:
2833
token: ${{ secrets.GITHUB_TOKEN }}
2934
command: 'version-or-publish'
3035
createRelease: true
36+
3137
- name: Create Pull Request With Versions Bumped
3238
if: steps.covector.outputs.commandRan == 'version'
3339
uses: tauri-apps/create-pull-request@v3.4.1

0 commit comments

Comments
 (0)