fix(ci): align Node and Tauri versions for desktop builds
This commit is contained in:
2
.github/workflows/build-and-upload.yml
vendored
2
.github/workflows/build-and-upload.yml
vendored
@@ -53,7 +53,7 @@ on:
|
|||||||
# least-privilege (e.g. dev CI uses read-only; releases grant write).
|
# least-privilege (e.g. dev CI uses read-only; releases grant write).
|
||||||
|
|
||||||
env:
|
env:
|
||||||
NODE_VERSION: 20
|
NODE_VERSION: 22
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-macos:
|
build-macos:
|
||||||
|
|||||||
2
.github/workflows/manual-npm-publish.yml
vendored
2
.github/workflows/manual-npm-publish.yml
vendored
@@ -46,7 +46,7 @@ jobs:
|
|||||||
publish:
|
publish:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
env:
|
env:
|
||||||
NODE_VERSION: 20
|
NODE_VERSION: 22
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|||||||
2
.github/workflows/release-ui.yml
vendored
2
.github/workflows/release-ui.yml
vendored
@@ -14,7 +14,7 @@ permissions:
|
|||||||
contents: read
|
contents: read
|
||||||
|
|
||||||
env:
|
env:
|
||||||
NODE_VERSION: 20
|
NODE_VERSION: 22
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
release-ui:
|
release-ui:
|
||||||
|
|||||||
2
.github/workflows/reusable-release.yml
vendored
2
.github/workflows/reusable-release.yml
vendored
@@ -39,7 +39,7 @@ permissions:
|
|||||||
contents: write
|
contents: write
|
||||||
|
|
||||||
env:
|
env:
|
||||||
NODE_VERSION: 20
|
NODE_VERSION: 22
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
prepare-release:
|
prepare-release:
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#!/usr/bin/env node
|
#!/usr/bin/env node
|
||||||
import { spawnSync } from "child_process"
|
import { spawnSync } from "child_process"
|
||||||
import { cpSync, existsSync, mkdirSync, rmSync } from "fs"
|
import { cpSync, existsSync, mkdirSync, readdirSync, rmSync } from "fs"
|
||||||
import path from "path"
|
import path from "path"
|
||||||
import { fileURLToPath } from "url"
|
import { fileURLToPath } from "url"
|
||||||
|
|
||||||
@@ -14,6 +14,43 @@ const selfLinkDir = path.resolve(nodeModulesDir, "@codenomad", "opencode-config"
|
|||||||
const npmExecPath = process.env.npm_execpath
|
const npmExecPath = process.env.npm_execpath
|
||||||
const npmNodeExecPath = process.env.npm_node_execpath
|
const npmNodeExecPath = process.env.npm_node_execpath
|
||||||
|
|
||||||
|
function stripNodeModuleBins(rootDir) {
|
||||||
|
const root = path.join(rootDir, "node_modules")
|
||||||
|
if (!existsSync(root)) {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
const stack = [root]
|
||||||
|
let removed = 0
|
||||||
|
|
||||||
|
while (stack.length > 0) {
|
||||||
|
const current = stack.pop()
|
||||||
|
if (!current) break
|
||||||
|
|
||||||
|
let entries
|
||||||
|
try {
|
||||||
|
entries = readdirSync(current, { withFileTypes: true })
|
||||||
|
} catch {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
for (const entry of entries) {
|
||||||
|
const full = path.join(current, entry.name)
|
||||||
|
if (entry.name === ".bin") {
|
||||||
|
rmSync(full, { recursive: true, force: true })
|
||||||
|
removed += 1
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
if (entry.isDirectory()) {
|
||||||
|
stack.push(full)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return removed
|
||||||
|
}
|
||||||
|
|
||||||
if (!existsSync(sourceDir)) {
|
if (!existsSync(sourceDir)) {
|
||||||
console.error(`[copy-opencode-config] Missing source directory at ${sourceDir}`)
|
console.error(`[copy-opencode-config] Missing source directory at ${sourceDir}`)
|
||||||
process.exit(1)
|
process.exit(1)
|
||||||
@@ -58,4 +95,9 @@ rmSync(targetDir, { recursive: true, force: true })
|
|||||||
mkdirSync(path.dirname(targetDir), { recursive: true })
|
mkdirSync(path.dirname(targetDir), { recursive: true })
|
||||||
cpSync(sourceDir, targetDir, { recursive: true })
|
cpSync(sourceDir, targetDir, { recursive: true })
|
||||||
|
|
||||||
|
const removedBins = stripNodeModuleBins(targetDir)
|
||||||
|
if (removedBins > 0) {
|
||||||
|
console.log(`[copy-opencode-config] Removed ${removedBins} node_modules/.bin directories`)
|
||||||
|
}
|
||||||
|
|
||||||
console.log(`[copy-opencode-config] Copied ${sourceDir} -> ${targetDir}`)
|
console.log(`[copy-opencode-config] Copied ${sourceDir} -> ${targetDir}`)
|
||||||
|
|||||||
@@ -5,10 +5,10 @@ edition = "2021"
|
|||||||
license = "MIT"
|
license = "MIT"
|
||||||
|
|
||||||
[build-dependencies]
|
[build-dependencies]
|
||||||
tauri-build = { version = "2.5.2", features = [] }
|
tauri-build = { version = "2.5.6", features = [] }
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
tauri = { version = "2.5.2", features = [ "devtools"] }
|
tauri = { version = "2.10.3", features = [ "devtools"] }
|
||||||
serde = { version = "1", features = ["derive"] }
|
serde = { version = "1", features = ["derive"] }
|
||||||
serde_json = "1"
|
serde_json = "1"
|
||||||
serde_yaml = "0.9"
|
serde_yaml = "0.9"
|
||||||
|
|||||||
Reference in New Issue
Block a user