fix(ci): support desktop release retries
This commit is contained in:
@@ -17,7 +17,7 @@ concurrency:
|
|||||||
cancel-in-progress: false
|
cancel-in-progress: false
|
||||||
|
|
||||||
env:
|
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:
|
jobs:
|
||||||
publish-macos:
|
publish-macos:
|
||||||
@@ -39,6 +39,18 @@ jobs:
|
|||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
ref: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.tag || github.ref }}
|
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
|
- name: Setup Node
|
||||||
uses: actions/setup-node@v4
|
uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
@@ -67,8 +79,8 @@ jobs:
|
|||||||
const fs = require('node:fs');
|
const fs = require('node:fs');
|
||||||
const path = require('node:path');
|
const path = require('node:path');
|
||||||
|
|
||||||
const rawTag = process.env.RELEASE_TAG;
|
const rawTag = process.env.SOURCE_TAG;
|
||||||
if (!rawTag) throw new Error('RELEASE_TAG env var is missing');
|
if (!rawTag) throw new Error('SOURCE_TAG env var is missing');
|
||||||
|
|
||||||
const version = rawTag.replace(/^desktop-/, '').replace(/^v/, '');
|
const version = rawTag.replace(/^desktop-/, '').replace(/^v/, '');
|
||||||
console.log(`Using desktop version ${version} from tag ${rawTag}`);
|
console.log(`Using desktop version ${version} from tag ${rawTag}`);
|
||||||
@@ -145,6 +157,18 @@ jobs:
|
|||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
ref: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.tag || github.ref }}
|
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
|
- name: Install Linux packaging dependencies
|
||||||
run: |
|
run: |
|
||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
@@ -176,8 +200,8 @@ jobs:
|
|||||||
const fs = require('node:fs');
|
const fs = require('node:fs');
|
||||||
const path = require('node:path');
|
const path = require('node:path');
|
||||||
|
|
||||||
const rawTag = process.env.RELEASE_TAG;
|
const rawTag = process.env.SOURCE_TAG;
|
||||||
if (!rawTag) throw new Error('RELEASE_TAG env var is missing');
|
if (!rawTag) throw new Error('SOURCE_TAG env var is missing');
|
||||||
|
|
||||||
const version = rawTag.replace(/^desktop-/, '').replace(/^v/, '');
|
const version = rawTag.replace(/^desktop-/, '').replace(/^v/, '');
|
||||||
console.log(`Using desktop version ${version} from tag ${rawTag}`);
|
console.log(`Using desktop version ${version} from tag ${rawTag}`);
|
||||||
@@ -248,6 +272,18 @@ jobs:
|
|||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
ref: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.tag || github.ref }}
|
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
|
- name: Setup Node
|
||||||
uses: actions/setup-node@v4
|
uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
@@ -274,8 +310,8 @@ jobs:
|
|||||||
const fs = require('node:fs');
|
const fs = require('node:fs');
|
||||||
const path = require('node:path');
|
const path = require('node:path');
|
||||||
|
|
||||||
const rawTag = process.env.RELEASE_TAG;
|
const rawTag = process.env.SOURCE_TAG;
|
||||||
if (!rawTag) throw new Error('RELEASE_TAG env var is missing');
|
if (!rawTag) throw new Error('SOURCE_TAG env var is missing');
|
||||||
|
|
||||||
const version = rawTag.replace(/^desktop-/, '').replace(/^v/, '');
|
const version = rawTag.replace(/^desktop-/, '').replace(/^v/, '');
|
||||||
console.log(`Using desktop version ${version} from tag ${rawTag}`);
|
console.log(`Using desktop version ${version} from tag ${rawTag}`);
|
||||||
|
|||||||
@@ -8,7 +8,11 @@ if (!hasDraggableFlatlist) {
|
|||||||
process.exit(0);
|
process.exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
const cmd = process.platform === "win32" ? "patch-package.cmd" : "patch-package";
|
const isWindows = process.platform === "win32";
|
||||||
const result = spawnSync(cmd, { stdio: "inherit" });
|
const cmd = isWindows ? "patch-package.cmd" : "patch-package";
|
||||||
|
const result = spawnSync(cmd, [], {
|
||||||
|
shell: isWindows,
|
||||||
|
stdio: "inherit",
|
||||||
|
windowsHide: true,
|
||||||
|
});
|
||||||
process.exit(result.status ?? 1);
|
process.exit(result.status ?? 1);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user