ci: fix expressions using secrets.* in if by moving to env-based guard; add Windows-safe key injection
This commit is contained in:
parent
66a5e2751b
commit
55791a0503
2 changed files with 17 additions and 8 deletions
10
.github/workflows/ci-cd-web-desktop.yml
vendored
10
.github/workflows/ci-cd-web-desktop.yml
vendored
|
|
@ -332,6 +332,8 @@ jobs:
|
|||
name: Desktop Release (Windows)
|
||||
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
|
||||
runs-on: [ self-hosted, windows, desktop ]
|
||||
env:
|
||||
TAURI_PUBLIC_KEY: ${{ secrets.TAURI_PUBLIC_KEY }}
|
||||
defaults:
|
||||
run:
|
||||
working-directory: apps/desktop
|
||||
|
|
@ -363,11 +365,11 @@ jobs:
|
|||
projectPath: apps/desktop
|
||||
|
||||
- name: Inject Tauri public key (post)
|
||||
if: ${{ secrets.TAURI_PUBLIC_KEY != '' }}
|
||||
env:
|
||||
TAURI_PUBLIC_KEY: ${{ secrets.TAURI_PUBLIC_KEY }}
|
||||
if: ${{ env.TAURI_PUBLIC_KEY != '' }}
|
||||
shell: pwsh
|
||||
run: |
|
||||
sed -i "s/REPLACE_WITH_TAURI_PUBLIC_KEY/${TAURI_PUBLIC_KEY//\//\\\/}/" apps/desktop/src-tauri/tauri.conf.json || true
|
||||
$p = 'apps/desktop/src-tauri/tauri.conf.json'
|
||||
(Get-Content $p) -replace 'REPLACE_WITH_TAURI_PUBLIC_KEY', $env:TAURI_PUBLIC_KEY | Set-Content $p
|
||||
|
||||
- name: Upload latest.json + bundles to VPS
|
||||
uses: appleboy/scp-action@v0.1.7
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue