diff --git a/.github/workflows/desktop-release.yml b/.github/workflows/desktop-release.yml index 1f04683a9..d7d9baa14 100644 --- a/.github/workflows/desktop-release.yml +++ b/.github/workflows/desktop-release.yml @@ -17,7 +17,7 @@ concurrency: cancel-in-progress: false env: - RELEASE_TAG: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.tag || github.ref_name }} + SOURCE_TAG: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.tag || github.ref_name }} jobs: publish-macos: @@ -39,6 +39,18 @@ jobs: fetch-depth: 0 ref: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.tag || github.ref }} + - name: Normalize release tag + shell: bash + run: | + set -euo pipefail + source_tag="${SOURCE_TAG}" + if [[ "$source_tag" == desktop-v* ]]; then + release_tag="v${source_tag#desktop-v}" + else + release_tag="$source_tag" + fi + echo "RELEASE_TAG=$release_tag" >> "$GITHUB_ENV" + - name: Setup Node uses: actions/setup-node@v4 with: @@ -67,8 +79,8 @@ jobs: const fs = require('node:fs'); const path = require('node:path'); - const rawTag = process.env.RELEASE_TAG; - if (!rawTag) throw new Error('RELEASE_TAG env var is missing'); + const rawTag = process.env.SOURCE_TAG; + if (!rawTag) throw new Error('SOURCE_TAG env var is missing'); const version = rawTag.replace(/^desktop-/, '').replace(/^v/, ''); console.log(`Using desktop version ${version} from tag ${rawTag}`); @@ -145,6 +157,18 @@ jobs: fetch-depth: 0 ref: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.tag || github.ref }} + - name: Normalize release tag + shell: bash + run: | + set -euo pipefail + source_tag="${SOURCE_TAG}" + if [[ "$source_tag" == desktop-v* ]]; then + release_tag="v${source_tag#desktop-v}" + else + release_tag="$source_tag" + fi + echo "RELEASE_TAG=$release_tag" >> "$GITHUB_ENV" + - name: Install Linux packaging dependencies run: | sudo apt-get update @@ -176,8 +200,8 @@ jobs: const fs = require('node:fs'); const path = require('node:path'); - const rawTag = process.env.RELEASE_TAG; - if (!rawTag) throw new Error('RELEASE_TAG env var is missing'); + const rawTag = process.env.SOURCE_TAG; + if (!rawTag) throw new Error('SOURCE_TAG env var is missing'); const version = rawTag.replace(/^desktop-/, '').replace(/^v/, ''); console.log(`Using desktop version ${version} from tag ${rawTag}`); @@ -248,6 +272,18 @@ jobs: fetch-depth: 0 ref: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.tag || github.ref }} + - name: Normalize release tag + shell: bash + run: | + set -euo pipefail + source_tag="${SOURCE_TAG}" + if [[ "$source_tag" == desktop-v* ]]; then + release_tag="v${source_tag#desktop-v}" + else + release_tag="$source_tag" + fi + echo "RELEASE_TAG=$release_tag" >> "$GITHUB_ENV" + - name: Setup Node uses: actions/setup-node@v4 with: @@ -274,8 +310,8 @@ jobs: const fs = require('node:fs'); const path = require('node:path'); - const rawTag = process.env.RELEASE_TAG; - if (!rawTag) throw new Error('RELEASE_TAG env var is missing'); + const rawTag = process.env.SOURCE_TAG; + if (!rawTag) throw new Error('SOURCE_TAG env var is missing'); const version = rawTag.replace(/^desktop-/, '').replace(/^v/, ''); console.log(`Using desktop version ${version} from tag ${rawTag}`); diff --git a/scripts/postinstall-patches.mjs b/scripts/postinstall-patches.mjs index ea0caeea3..80b2dfab7 100644 --- a/scripts/postinstall-patches.mjs +++ b/scripts/postinstall-patches.mjs @@ -8,7 +8,11 @@ if (!hasDraggableFlatlist) { process.exit(0); } -const cmd = process.platform === "win32" ? "patch-package.cmd" : "patch-package"; -const result = spawnSync(cmd, { stdio: "inherit" }); +const isWindows = process.platform === "win32"; +const cmd = isWindows ? "patch-package.cmd" : "patch-package"; +const result = spawnSync(cmd, [], { + shell: isWindows, + stdio: "inherit", + windowsHide: true, +}); process.exit(result.status ?? 1); -