🐛 update cache
This commit is contained in:
18
.github/workflows/pake-cli.yaml
vendored
18
.github/workflows/pake-cli.yaml
vendored
@@ -118,18 +118,32 @@ jobs:
|
|||||||
id: pake_cache
|
id: pake_cache
|
||||||
with:
|
with:
|
||||||
path: node_modules/pake-cli
|
path: node_modules/pake-cli
|
||||||
key: ${{ runner.os }}-pake-cli-${{ hashFiles('**/package.json') }}
|
key: ${{ runner.os }}-pake-cli-${{ hashFiles('**/package.json') }}-${{ inputs.multi_arch }}
|
||||||
|
|
||||||
- name: Install pake-cli and script dependencies
|
- name: Install pake-cli and script dependencies
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
|
echo "Checking pake-cli installation..."
|
||||||
if [ ! -d "node_modules/pake-cli" ]; then
|
if [ ! -d "node_modules/pake-cli" ]; then
|
||||||
echo "Installing pake-cli..."
|
echo "Installing pake-cli..."
|
||||||
npm install pake-cli
|
npm install pake-cli --no-package-lock
|
||||||
else
|
else
|
||||||
echo "pake-cli found in cache"
|
echo "pake-cli found in cache"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Always install script dependencies
|
||||||
|
echo "Installing script dependencies..."
|
||||||
npm install execa axios --no-package-lock
|
npm install execa axios --no-package-lock
|
||||||
|
|
||||||
|
# Verify installation
|
||||||
|
if [ ! -d "node_modules/pake-cli" ]; then
|
||||||
|
echo "Error: Failed to install pake-cli"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Listing pake-cli contents:"
|
||||||
|
ls -la node_modules/pake-cli/ | head -5
|
||||||
|
echo "pake-cli installation verified"
|
||||||
|
|
||||||
- name: Rust cache restore
|
- name: Rust cache restore
|
||||||
uses: actions/cache/restore@v4.2.0
|
uses: actions/cache/restore@v4.2.0
|
||||||
|
|||||||
32
script/build_with_pake_cli.js
vendored
32
script/build_with_pake_cli.js
vendored
@@ -26,8 +26,35 @@ const main = async () => {
|
|||||||
logConfiguration();
|
logConfiguration();
|
||||||
|
|
||||||
const cliPath = path.join(process.cwd(), "node_modules/pake-cli");
|
const cliPath = path.join(process.cwd(), "node_modules/pake-cli");
|
||||||
|
|
||||||
|
// Check if pake-cli directory exists
|
||||||
|
if (!fs.existsSync(cliPath)) {
|
||||||
|
console.error("Error: pake-cli not found at", cliPath);
|
||||||
|
console.error("Please make sure pake-cli is installed: npm install pake-cli");
|
||||||
|
process.exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
process.chdir(cliPath);
|
process.chdir(cliPath);
|
||||||
|
|
||||||
|
// Clean up any previous configuration to ensure fresh build
|
||||||
|
const pakeDirPath = path.join("src-tauri", ".pake");
|
||||||
|
|
||||||
|
// Remove .pake directory to force fresh config generation
|
||||||
|
if (fs.existsSync(pakeDirPath)) {
|
||||||
|
fs.rmSync(pakeDirPath, { recursive: true, force: true });
|
||||||
|
console.log("Cleaned previous .pake directory");
|
||||||
|
}
|
||||||
|
|
||||||
|
// Fix hardcoded default config in npm package
|
||||||
|
const defaultConfigPath = path.join("src-tauri", "tauri.conf.json");
|
||||||
|
if (fs.existsSync(defaultConfigPath)) {
|
||||||
|
const defaultConfig = JSON.parse(fs.readFileSync(defaultConfigPath, 'utf8'));
|
||||||
|
defaultConfig.productName = process.env.NAME;
|
||||||
|
defaultConfig.identifier = `com.pake.${process.env.NAME.toLowerCase()}`;
|
||||||
|
fs.writeFileSync(defaultConfigPath, JSON.stringify(defaultConfig, null, 2));
|
||||||
|
console.log(`Fixed default config: productName -> ${process.env.NAME}`);
|
||||||
|
}
|
||||||
|
|
||||||
// Build CLI parameters
|
// Build CLI parameters
|
||||||
let params = [
|
let params = [
|
||||||
"dist/cli.js",
|
"dist/cli.js",
|
||||||
@@ -76,9 +103,8 @@ const main = async () => {
|
|||||||
console.log("Expected app name:", process.env.NAME);
|
console.log("Expected app name:", process.env.NAME);
|
||||||
console.log("Compiling....");
|
console.log("Compiling....");
|
||||||
|
|
||||||
// Execute the CLI command with extended timeout
|
// Execute the CLI command
|
||||||
const timeout = 900000; // 15 minutes for all builds
|
await execa("node", params, { stdio: "inherit" });
|
||||||
await execa("node", params, { stdio: "inherit", timeout });
|
|
||||||
|
|
||||||
// Create output directory and move built files
|
// Create output directory and move built files
|
||||||
if (!fs.existsSync("output")) {
|
if (!fs.existsSync("output")) {
|
||||||
|
|||||||
Reference in New Issue
Block a user