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
15
.github/workflows/desktop-release.yml
vendored
15
.github/workflows/desktop-release.yml
vendored
|
|
@ -13,6 +13,8 @@ jobs:
|
|||
build:
|
||||
name: Build ${{ matrix.platform }}
|
||||
runs-on: ${{ matrix.runner }}
|
||||
env:
|
||||
TAURI_PUBLIC_KEY: ${{ secrets.TAURI_PUBLIC_KEY }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
|
|
@ -50,14 +52,19 @@ jobs:
|
|||
- name: Install pnpm deps
|
||||
run: pnpm -C apps/desktop install --frozen-lockfile
|
||||
|
||||
- name: Inject Tauri public key
|
||||
if: ${{ secrets.TAURI_PUBLIC_KEY != '' }}
|
||||
env:
|
||||
TAURI_PUBLIC_KEY: ${{ secrets.TAURI_PUBLIC_KEY }}
|
||||
- name: Inject Tauri public key (Linux/macOS)
|
||||
if: ${{ env.TAURI_PUBLIC_KEY != '' && matrix.platform != 'windows' }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
sed -i "s/REPLACE_WITH_TAURI_PUBLIC_KEY/${TAURI_PUBLIC_KEY//\//\\\/}/" apps/desktop/src-tauri/tauri.conf.json
|
||||
|
||||
- name: Inject Tauri public key (Windows)
|
||||
if: ${{ env.TAURI_PUBLIC_KEY != '' && matrix.platform == 'windows' }}
|
||||
shell: pwsh
|
||||
run: |
|
||||
$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: Build desktop
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue