diff --git a/.changes/cli-plugin-template-covector.md b/.changes/cli-plugin-template-covector.md new file mode 100644 index 000000000..73e234b5b --- /dev/null +++ b/.changes/cli-plugin-template-covector.md @@ -0,0 +1,6 @@ +--- +"cli.rs": patch +"cli.js": patch +--- + +Fixes the covector configuration on the plugin templates. diff --git a/tooling/cli/templates/plugin/backend/.changes/config.json b/tooling/cli/templates/plugin/backend/.changes/config.json index ad5fc10af..feeb41d27 100755 --- a/tooling/cli/templates/plugin/backend/.changes/config.json +++ b/tooling/cli/templates/plugin/backend/.changes/config.json @@ -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", diff --git a/tooling/cli/templates/plugin/backend/.github/workflows/covector-version-or-publish.yml b/tooling/cli/templates/plugin/backend/.github/workflows/covector-version-or-publish.yml index 6b75ca64e..e838c1e73 100755 --- a/tooling/cli/templates/plugin/backend/.github/workflows/covector-version-or-publish.yml +++ b/tooling/cli/templates/plugin/backend/.github/workflows/covector-version-or-publish.yml @@ -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 diff --git a/tooling/cli/templates/plugin/with-api/.changes/config.json b/tooling/cli/templates/plugin/with-api/.changes/config.json index 1cc6dfc56..929569f87 100755 --- a/tooling/cli/templates/plugin/with-api/.changes/config.json +++ b/tooling/cli/templates/plugin/with-api/.changes/config.json @@ -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 }}" + ] } } } diff --git a/tooling/cli/templates/plugin/with-api/.github/workflows/covector-version-or-publish.yml b/tooling/cli/templates/plugin/with-api/.github/workflows/covector-version-or-publish.yml index 6b75ca64e..e838c1e73 100644 --- a/tooling/cli/templates/plugin/with-api/.github/workflows/covector-version-or-publish.yml +++ b/tooling/cli/templates/plugin/with-api/.github/workflows/covector-version-or-publish.yml @@ -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