🎨 update pake cli actions
This commit is contained in:
35
.github/workflows/pake-cli.yaml
vendored
35
.github/workflows/pake-cli.yaml
vendored
@@ -68,6 +68,7 @@ jobs:
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 22
|
||||
cache: 'npm'
|
||||
|
||||
- name: Install Rust for ubuntu-24.04
|
||||
if: inputs.platform == 'ubuntu-24.04'
|
||||
@@ -102,11 +103,32 @@ jobs:
|
||||
packages: libsoup-3.0-dev libdbus-1-dev libjavascriptcoregtk-4.1-dev libwebkit2gtk-4.1-dev build-essential curl wget file libxdo-dev libssl-dev libgtk-3-dev libayatana-appindicator3-dev librsvg2-dev gnome-video-effects gnome-video-effects-extra
|
||||
version: 1.1
|
||||
|
||||
- name: Install pake-cli local
|
||||
shell: bash
|
||||
- name: Cache Node dependencies
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: |
|
||||
node_modules
|
||||
~/.npm
|
||||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-node-
|
||||
|
||||
- name: Cache pake-cli installation
|
||||
uses: actions/cache@v4
|
||||
id: pake_cache
|
||||
with:
|
||||
path: node_modules/pake-cli
|
||||
key: ${{ runner.os }}-pake-cli-${{ hashFiles('**/package.json') }}
|
||||
|
||||
- name: Install pake-cli and script dependencies
|
||||
run: |
|
||||
echo "install pake on local"
|
||||
npm install pake-cli
|
||||
if [ ! -d "node_modules/pake-cli" ]; then
|
||||
echo "Installing pake-cli..."
|
||||
npm install pake-cli
|
||||
else
|
||||
echo "pake-cli found in cache"
|
||||
fi
|
||||
npm install execa axios --no-package-lock
|
||||
|
||||
- name: Rust cache restore
|
||||
uses: actions/cache/restore@v4.2.0
|
||||
@@ -120,11 +142,6 @@ jobs:
|
||||
node_modules/pake-cli/src-tauri/target/
|
||||
key: ${{ inputs.platform }}-cargo-${{ hashFiles('node_modules/pake-cli/src-tauri/Cargo.lock') }}
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
npm install execa
|
||||
npm install axios
|
||||
|
||||
- name: Build with pake-cli
|
||||
timeout-minutes: 15
|
||||
run: |
|
||||
|
||||
2
bin/builders/BaseBuilder.ts
vendored
2
bin/builders/BaseBuilder.ts
vendored
@@ -36,7 +36,7 @@ export default abstract class BaseBuilder {
|
||||
}
|
||||
|
||||
private getBuildTimeout(): number {
|
||||
return 300000; // 5 minutes for build process
|
||||
return 900000; // 15 minutes for all builds
|
||||
}
|
||||
|
||||
async prepare() {
|
||||
|
||||
46
script/build_with_pake_cli.js
vendored
46
script/build_with_pake_cli.js
vendored
@@ -97,17 +97,24 @@ const main = async () => {
|
||||
let params = buildParameters();
|
||||
|
||||
// Multi-arch target is now handled in GitHub Actions workflow
|
||||
|
||||
|
||||
// Download icon in parallel with parameter preparation if needed
|
||||
let iconPromise = null;
|
||||
if (process.env.ICON && process.env.ICON !== "") {
|
||||
const iconFile = getIconFileName();
|
||||
const iconParams = await downloadIcon(iconFile);
|
||||
params.push(...iconParams);
|
||||
iconPromise = downloadIcon(iconFile);
|
||||
} else {
|
||||
console.log(
|
||||
"Won't download the icon as ICON environment variable is not defined!",
|
||||
);
|
||||
}
|
||||
|
||||
// If icon is being downloaded, wait for it and add to params
|
||||
if (iconPromise) {
|
||||
const iconParams = await iconPromise;
|
||||
params.push(...iconParams);
|
||||
}
|
||||
|
||||
console.log("Pake parameters:", params.join(" "));
|
||||
console.log("Compiling....");
|
||||
|
||||
@@ -119,14 +126,45 @@ const main = async () => {
|
||||
fs.mkdirSync("output");
|
||||
}
|
||||
|
||||
// Move built files to output directory
|
||||
// Move built files to output directory more efficiently
|
||||
const buildPaths = [
|
||||
`src-tauri/target/release/bundle`,
|
||||
`src-tauri/target/universal-apple-darwin/release/bundle`
|
||||
];
|
||||
|
||||
for (const buildPath of buildPaths) {
|
||||
if (fs.existsSync(buildPath)) {
|
||||
const bundleFiles = fs.readdirSync(buildPath, { recursive: true })
|
||||
.filter(file => {
|
||||
const fullPath = path.join(buildPath, file);
|
||||
return fs.statSync(fullPath).isFile() &&
|
||||
(file.endsWith('.dmg') || file.endsWith('.exe') ||
|
||||
file.endsWith('.deb') || file.endsWith('.rpm') || file.endsWith('.AppImage'));
|
||||
});
|
||||
|
||||
for (const file of bundleFiles) {
|
||||
const srcPath = path.join(buildPath, file);
|
||||
const destPath = path.join("output", path.basename(file));
|
||||
await execa("cp", [srcPath, destPath]);
|
||||
}
|
||||
break; // Found files, no need to check other paths
|
||||
}
|
||||
}
|
||||
|
||||
// Fallback to original method if no bundle files found
|
||||
const files = fs.readdirSync(".");
|
||||
const namePattern = new RegExp(`^${process.env.NAME}\\..*$`);
|
||||
let foundFiles = false;
|
||||
for (const file of files) {
|
||||
if (namePattern.test(file)) {
|
||||
await execa("mv", [file, path.join("output", file)]);
|
||||
foundFiles = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (!foundFiles) {
|
||||
console.log("Warning: No output files found matching pattern");
|
||||
}
|
||||
|
||||
console.log("Build Success");
|
||||
process.chdir("../..");
|
||||
|
||||
Reference in New Issue
Block a user