Skip to content

Commit 803c3a7

Browse files
authored
feat(cli): expose CLI signer flags as environment variables (#8327)
* feat(cli): expose signer flags as environment variables * Update .changes/cli-signer-env-vars.md
1 parent f98ce5a commit 803c3a7

File tree

2 files changed

+22
-3
lines changed

2 files changed

+22
-3
lines changed

.changes/cli-signer-env-vars.md

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
'tauri-cli': 'patch:enhance'
3+
---
4+
5+
Read the following env vars when using the `tauri signer sign` command to make it easier to use in CI.
6+
7+
- `TAURI_PRIVATE_KEY`
8+
- `TAURI_PRIVATE_KEY_PASSWORD`
9+
- `TAURI_PRIVATE_KEY_PATH`

tooling/cli/src/signer/sign.rs

+13-3
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,23 @@ use tauri_utils::display_path;
1717
#[clap(about = "Sign a file")]
1818
pub struct Options {
1919
/// Load the private key from a string
20-
#[clap(short = 'k', long, conflicts_with("private_key_path"))]
20+
#[clap(
21+
short = 'k',
22+
long,
23+
conflicts_with("private_key_path"),
24+
env = "TAURI_PRIVATE_KEY"
25+
)]
2126
private_key: Option<String>,
2227
/// Load the private key from a file
23-
#[clap(short = 'f', long, conflicts_with("private_key"))]
28+
#[clap(
29+
short = 'f',
30+
long,
31+
conflicts_with("private_key"),
32+
env = "TAURI_PRIVATE_KEY_PATH"
33+
)]
2434
private_key_path: Option<PathBuf>,
2535
/// Set private key password when signing
26-
#[clap(short, long)]
36+
#[clap(short, long, env = "TAURI_PRIVATE_KEY_PASSWORD")]
2737
password: Option<String>,
2838
/// Sign the specified file
2939
file: PathBuf,

0 commit comments

Comments
 (0)