fix(cli): add prepublish scripts to the plugin templates

This commit is contained in:
Lucas Nogueira
2022-06-19 15:49:08 -03:00
parent 07f9079532
commit b8a64d01ba
5 changed files with 81 additions and 1 deletions

View File

@@ -0,0 +1,6 @@
---
"cli.rs": patch
"cli.js": patch
---
Fixes the covector configuration on the plugin templates.

View File

@@ -4,6 +4,36 @@
"rust": {
"version": true,
"getPublishedVersion": "cargo search ${ pkg.pkg } --limit 1 | sed -nE 's/^[^\"]*\"//; s/\".*//1p' -",
"prepublish": [
"sudo apt-get update",
"sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0",
"cargo install cargo-audit",
{
"command": "cargo generate-lockfile",
"dryRunCommand": true,
"pipe": true
},
{
"command": "echo \"# Cargo Audit\"",
"dryRunCommand": true,
"pipe": true
},
{
"command": "echo '```'",
"dryRunCommand": true,
"pipe": true
},
{
"command": "cargo audit ${ process.env.CARGO_AUDIT_OPTIONS || '' }",
"dryRunCommand": true,
"pipe": true
},
{
"command": "echo '```'",
"dryRunCommand": true,
"pipe": true
}
],
"publish": [
{
"command": "cargo package --allow-dirty",

View File

@@ -17,10 +17,15 @@ jobs:
with:
node-version: 12
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
uses: jbolda/covector/packages/action@covector-v0
id: covector
@@ -28,6 +33,7 @@ jobs:
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

View File

@@ -4,6 +4,36 @@
"rust": {
"version": true,
"getPublishedVersion": "cargo search ${ pkg.pkg } --limit 1 | sed -nE 's/^[^\"]*\"//; s/\".*//1p' -",
"prepublish": [
"sudo apt-get update",
"sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0",
"cargo install cargo-audit",
{
"command": "cargo generate-lockfile",
"dryRunCommand": true,
"pipe": true
},
{
"command": "echo \"# Cargo Audit\"",
"dryRunCommand": true,
"pipe": true
},
{
"command": "echo '```'",
"dryRunCommand": true,
"pipe": true
},
{
"command": "cargo audit ${ process.env.CARGO_AUDIT_OPTIONS || '' }",
"dryRunCommand": true,
"pipe": true
},
{
"command": "echo '```'",
"dryRunCommand": true,
"pipe": true
}
],
"publish": [
{
"command": "cargo package --allow-dirty",
@@ -66,7 +96,9 @@
"tauri-plugin-{{ plugin_name }}-api": {
"path": ".",
"manager": "javascript",
"dependencies": ["tauri-plugin-{{ plugin_name }}"]
"dependencies": [
"tauri-plugin-{{ plugin_name }}"
]
}
}
}

View File

@@ -17,10 +17,15 @@ jobs:
with:
node-version: 12
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
uses: jbolda/covector/packages/action@covector-v0
id: covector
@@ -28,6 +33,7 @@ jobs:
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