Skip to content

Commit 1a1f928

Browse files
committed
fix builds
1 parent f3e73a9 commit 1a1f928

File tree

7 files changed

+31
-12
lines changed

7 files changed

+31
-12
lines changed

.github/actions/install-all-build-libs/action.yml

-4
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,6 @@ runs:
99
uses: actions/setup-node@v4
1010
with:
1111
node-version: '20.18.0'
12-
# disable cache for windows
13-
# https://github.com/actions/setup-node/issues/975
14-
cache: 'yarn'
15-
cache-dependency-path: '**/yarn.lock'
1612

1713
- name: Install dependencies for root package.js
1814
shell: bash

.github/workflows/pipeline-build-linux.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
uses: ./.github/actions/download-backend
3636

3737
- name: Set RI_SEGMENT_WRITE_KEY to .env file
38-
run: echo "RI_SEGMENT_WRITE_KEY='$RI_SEGMENT_WRITE_KEY'" >> $envFile
38+
run: echo "RI_SEGMENT_WRITE_KEY='${{ env.RI_SEGMENT_WRITE_KEY }}'" >> ${{ env.envFile }}
3939

4040
- name: Build linux package (production)
4141
if: inputs.environment == 'production'
@@ -45,7 +45,7 @@ jobs:
4545
- name: Build linux package (staging)
4646
if: inputs.environment == 'staging'
4747
run: |
48-
sed -i "s/^RI_APP_FOLDER_NAME=.*/RI_APP_FOLDER_NAME='.redis-for-vscode-stage'/" $envFile
48+
sed -i "s/^RI_APP_FOLDER_NAME=.*/RI_APP_FOLDER_NAME='.redis-for-vscode-stage'/" ${{ env.envFile }}
4949
yarn package:stage --target linux-x64 --out ${packagePath}
5050
5151
- uses: actions/upload-artifact@v4

.github/workflows/pipeline-build-macos.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
uses: ./.github/actions/install-all-build-libs
2929

3030
- name: Set RI_SEGMENT_WRITE_KEY to .env file
31-
run: echo "RI_SEGMENT_WRITE_KEY='$RI_SEGMENT_WRITE_KEY'" >> $envFile
31+
run: echo "RI_SEGMENT_WRITE_KEY='${{ env.RI_SEGMENT_WRITE_KEY }}'" >> ${{ env.envFile }}
3232

3333
- name: Download backend x64
3434
uses: ./.github/actions/download-backend
@@ -38,7 +38,7 @@ jobs:
3838
- name: Build macos x64 package (staging)
3939
if: inputs.environment != 'production'
4040
run: |
41-
sed -i '' "s/^RI_APP_FOLDER_NAME=.*/RI_APP_FOLDER_NAME='.redis-for-vscode-stage'/" $envFile
41+
sed -i '' "s/^RI_APP_FOLDER_NAME=.*/RI_APP_FOLDER_NAME='.redis-for-vscode-stage'/" ${{ env.envFile }}
4242
4343
yarn package:stage --target darwin-x64 --out ${packagePath}-x64.vsix
4444
@@ -55,7 +55,7 @@ jobs:
5555
- name: Build macos arm64 package (staging)
5656
if: inputs.environment != 'production'
5757
run: |
58-
sed -i '' "s/^RI_APP_FOLDER_NAME=.*/RI_APP_FOLDER_NAME='.redis-for-vscode-stage'/" $envFile
58+
sed -i '' "s/^RI_APP_FOLDER_NAME=.*/RI_APP_FOLDER_NAME='.redis-for-vscode-stage'/" ${{ env.envFile }}
5959
6060
yarn package:stage --target darwin-arm64 --out ${packagePath}-arm64.vsix
6161

.github/workflows/pipeline-build-windows.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
uses: ./.github/actions/download-backend
2626

2727
- name: Set RI_SEGMENT_WRITE_KEY to .env file
28-
run: echo "RI_SEGMENT_WRITE_KEY='$RI_SEGMENT_WRITE_KEY'" >> $envFile
28+
run: echo "RI_SEGMENT_WRITE_KEY='${{ env.RI_SEGMENT_WRITE_KEY }}'" >> ${{ env.envFile }}
2929

3030
- name: Build windows package (production)
3131
if: inputs.environment == 'production'
@@ -35,7 +35,7 @@ jobs:
3535
- name: Build windows package (staging)
3636
if: inputs.environment == 'staging'
3737
run: |
38-
sed -i "s/^RI_APP_FOLDER_NAME=.*/RI_APP_FOLDER_NAME='.redis-for-vscode-stage'/" $envFile
38+
sed -i "s/^RI_APP_FOLDER_NAME=.*/RI_APP_FOLDER_NAME='.redis-for-vscode-stage'/" ${{ env.envFile }}
3939
yarn package:stage --target win32-x64 --out ${{ env.packagePath }}
4040
4141
- uses: actions/upload-artifact@v4

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,7 @@
236236
"ts-node": "^10.9.1",
237237
"tsconfig-paths": "^4.2.0",
238238
"typescript": "^5.4.5",
239+
"upath": "^2.0.1",
239240
"uuid": "^9.0.1",
240241
"vite": "^5.2.10",
241242
"vite-plugin-react-click-to-component": "^3.0.0",

scripts/downloadBackend.ts

+18-1
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@ import * as fs from 'fs'
33
import * as path from 'path'
44
import * as cp from 'child_process'
55
import * as dotenv from 'dotenv'
6+
import * as upath from 'upath'
67
import { parse as parseUrl } from 'url'
78

9+
810
dotenv.config({
911
path: [
1012
path.join(__dirname, '..', '.env'),
@@ -80,13 +82,28 @@ async function downloadRedisBackendArchive(
8082
})
8183
}
8284

85+
function getNormalizedString(string: string) {
86+
return string?.startsWith('D:')
87+
? upath.normalize(string).replace('D:', '/d')
88+
: string
89+
}
90+
8391
function unzipRedisServer(redisInsideArchivePath: string, extractDir: string) {
8492
// tar does not create extractDir by default
8593
if (!fs.existsSync(extractDir)) {
8694
fs.mkdirSync(extractDir)
8795
}
8896

89-
cp.spawnSync('tar', ['-xf', redisInsideArchivePath, '-C', extractDir, '--strip-components', '1', 'api'])
97+
cp.spawnSync('tar', [
98+
'-xf',
99+
getNormalizedString(redisInsideArchivePath),
100+
'-C',
101+
getNormalizedString(extractDir),
102+
'--strip-components',
103+
'1',
104+
'api',
105+
])
106+
90107

91108
// remove tutorials
92109
fs.rmSync(tutorialsPath, { recursive: true, force: true });

yarn.lock

+5
Original file line numberDiff line numberDiff line change
@@ -8502,6 +8502,11 @@ universalify@^2.0.0:
85028502
resolved "https://registry.yarnpkg.com/universalify/-/universalify-2.0.1.tgz#168efc2180964e6386d061e094df61afe239b18d"
85038503
integrity sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==
85048504

8505+
upath@^2.0.1:
8506+
version "2.0.1"
8507+
resolved "https://registry.yarnpkg.com/upath/-/upath-2.0.1.tgz#50c73dea68d6f6b990f51d279ce6081665d61a8b"
8508+
integrity sha512-1uEe95xksV1O0CYKXo8vQvN1JEbtJp7lb7C5U9HMsIp6IVwntkH/oNUzyVNQSd4S1sYk2FpSSW44FqMc8qee5w==
8509+
85058510
update-browserslist-db@^1.0.13:
85068511
version "1.0.13"
85078512
resolved "https://registry.yarnpkg.com/update-browserslist-db/-/update-browserslist-db-1.0.13.tgz#3c5e4f5c083661bd38ef64b6328c26ed6c8248c4"

0 commit comments

Comments
 (0)