Skip to content

Commit c8d8fa8

Browse files
authored
fix: recommend install CLIs using --locked flag (#797)
* fix: recommend install CLIs using `--locked` flag * Update .github/workflows/templates-test.yml * Update .github/workflows/templates-test.yml * Update .github/workflows/audit.yml
1 parent ba3dea6 commit c8d8fa8

File tree

5 files changed

+21
-13
lines changed

5 files changed

+21
-13
lines changed

.changes/locked-flag.md

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
"create-tauri-app": "patch"
3+
"create-tauri-app-js": "patch"
4+
---
5+
6+
Suggest using `--locked` flag when installing CLIs using `cargo install`
7+

.github/workflows/audit.yml

+5-4
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,15 @@ concurrency:
2727
group: ${{ github.workflow }}-${{ github.ref }}
2828
cancel-in-progress: true
2929

30+
3031
jobs:
3132
audit-rust:
3233
runs-on: ubuntu-latest
3334
steps:
34-
- uses: actions/checkout@v3
35-
- uses: dtolnay/rust-toolchain@stable
36-
- run: cargo install cargo-audit
37-
- run: cargo audit
35+
- uses: actions/checkout@v4
36+
- uses: rustsec/audit-check@v2
37+
with:
38+
token: ${{ secrets.GITHUB_TOKEN }}
3839

3940
audit-js:
4041
runs-on: ubuntu-latest

.github/workflows/templates-test.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -96,19 +96,19 @@ jobs:
9696

9797
- uses: dtolnay/rust-toolchain@stable
9898

99-
- run: cargo install tauri-cli
99+
- run: cargo install tauri-cli --locked
100100
if: (matrix.settings.manager == 'cargo' || matrix.settings.manager == 'dotnet') && matrix.settings.rc != true
101101

102-
- run: cargo install tauri-cli --version '^2.0.0-rc'
102+
- run: cargo install tauri-cli --version '^2.0.0-rc' --locked
103103
if: (matrix.settings.manager == 'cargo' || matrix.settings.manager == 'dotnet') && matrix.settings.rc == true
104104

105105
- run: |
106106
rustup target add wasm32-unknown-unknown
107-
cargo install --locked trunk
107+
cargo install trunk --locked
108108
if: matrix.settings.install_trunk
109109
- run: |
110110
rustup target add wasm32-unknown-unknown
111-
cargo install --locked dioxus-cli
111+
cargo install dioxus-cli --locked
112112
if: matrix.settings.install_dioxus_cli
113113
114114
- name: install system dependencies

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ irm https://create.tauri.app/ps | iex
3232
## Cargo:
3333

3434
```bash
35-
cargo install create-tauri-app
35+
cargo install create-tauri-app --locked
3636
cargo create-tauri-app
3737
```
3838

src/deps.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -207,22 +207,22 @@ pub fn print_missing_deps(pkg_manager: PackageManager, template: Template, rc: b
207207
Dep {
208208
name: "Tauri CLI",
209209
instruction: if rc {
210-
format!("Run `{BLUE}{BOLD}cargo install tauri-cli --version '^2.0.0-rc'{RESET}`")
210+
format!("Run `{BLUE}{BOLD}cargo install tauri-cli --version '^2.0.0-rc' --locked{RESET}`")
211211
} else {
212-
format!("Run `{BLUE}{BOLD}cargo install tauri-cli{RESET}`")
212+
format!("Run `{BLUE}{BOLD}cargo install tauri-cli{RESET} --locked`")
213213
},
214214
exists: &|| is_appropriate_tauri_cli_installed(rc),
215215
skip: pkg_manager.is_node() || !template.needs_tauri_cli(),
216216
},
217217
Dep {
218218
name: "Trunk",
219-
instruction: format!("Run `{BLUE}{BOLD}cargo install trunk{RESET}`"),
219+
instruction: format!("Run `{BLUE}{BOLD}cargo install trunk --locked{RESET}`"),
220220
exists: &is_trunk_installed,
221221
skip: pkg_manager.is_node() || !template.needs_trunk(),
222222
},
223223
Dep {
224224
name: "Dioxus CLI",
225-
instruction: format!("Run `{BLUE}{BOLD}cargo install dioxus-cli{RESET}`"),
225+
instruction: format!("Run `{BLUE}{BOLD}cargo install dioxus-cli --locked{RESET}`"),
226226
exists: &is_dioxus_cli_installed,
227227
skip: pkg_manager.is_node() || !template.needs_dioxus_cli(),
228228
},

0 commit comments

Comments
 (0)