Skip to content

Commit a93af6e

Browse files
authored
fixing pwsh syntax for signing (#1336)
1 parent 8cb4ea9 commit a93af6e

File tree

1 file changed

+17
-9
lines changed

1 file changed

+17
-9
lines changed

.github/workflows/ci_release.yml

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -191,15 +191,23 @@ jobs:
191191
- name: Convert JKS to PFX
192192
shell: pwsh
193193
run: |
194-
& "${env:JAVA_HOME}\bin\keytool.exe" -importkeystore `
195-
-srckeystore "$PWD\signing.jks" `
196-
-srcstorepass $env:JKS_PASS `
197-
-srcalias $env:ALIAS `
198-
-srckeypass $env:JKS_PASS `
199-
-destkeystore "$PWD\cert.pfx" `
200-
-deststoretype PKCS12 `
201-
-deststorepass $env:PFX_PASS `
202-
-destkeypass $env:PFX_PASS
194+
if (($env:JKS_PASS).Length -lt 6) { throw "JKS_PASS must be at least 6 characters." }
195+
if (($env:PFX_PASS).Length -lt 6) { throw "PFX_PASS must be at least 6 characters." }
196+
197+
$kt = Join-Path $env:JAVA_HOME 'bin\keytool.exe'
198+
199+
$args = @(
200+
'-importkeystore',
201+
'-srckeystore', "$PWD\signing.jks",
202+
'-srcstorepass', $env:JKS_PASS,
203+
'-srcalias', $env:ALIAS,
204+
'-srckeypass', $env:JKS_PASS,
205+
'-destkeystore', "$PWD\cert.pfx",
206+
'-deststoretype','PKCS12',
207+
'-deststorepass',$env:PFX_PASS,
208+
'-destkeypass', $env:PFX_PASS
209+
)
210+
& $kt @args
203211
if (-not (Test-Path "$PWD\cert.pfx")) { throw "cert.pfx not created" }
204212
205213
- name: Prove PFX has a private key (fail fast)

0 commit comments

Comments
 (0)