🐛 GitHub action cli packaging issue fixed
This commit is contained in:
11
bin/builders/BaseBuilder.ts
vendored
11
bin/builders/BaseBuilder.ts
vendored
@@ -169,18 +169,25 @@ export default abstract class BaseBuilder {
|
||||
fullCommand += ' --bundles app';
|
||||
}
|
||||
|
||||
// Add features
|
||||
const features = ['cli-build'];
|
||||
|
||||
// Add macos-proxy feature for modern macOS (Darwin 23+ = macOS 14+)
|
||||
if (IS_MAC) {
|
||||
const macOSVersion = this.getMacOSMajorVersion();
|
||||
if (macOSVersion >= 23) {
|
||||
fullCommand += ' --features macos-proxy';
|
||||
features.push('macos-proxy');
|
||||
}
|
||||
}
|
||||
|
||||
if (features.length > 0) {
|
||||
fullCommand += ` --features ${features.join(',')}`;
|
||||
}
|
||||
|
||||
return fullCommand;
|
||||
}
|
||||
|
||||
private getMacOSMajorVersion(): number {
|
||||
protected getMacOSMajorVersion(): number {
|
||||
try {
|
||||
const os = require('os');
|
||||
const release = os.release();
|
||||
|
||||
33
bin/builders/MacBuilder.ts
vendored
33
bin/builders/MacBuilder.ts
vendored
@@ -1,3 +1,4 @@
|
||||
import path from 'path';
|
||||
import tauriConfig from '@/helpers/tauriConfig';
|
||||
import { PakeAppOptions } from '@/types';
|
||||
import BaseBuilder from './BaseBuilder';
|
||||
@@ -33,9 +34,35 @@ export default class MacBuilder extends BaseBuilder {
|
||||
}
|
||||
|
||||
protected getBuildCommand(): string {
|
||||
return this.options.multiArch
|
||||
? 'npm run build:mac'
|
||||
: super.getBuildCommand();
|
||||
if (this.options.multiArch) {
|
||||
const baseCommand = this.options.debug
|
||||
? 'npm run tauri build -- --debug'
|
||||
: 'npm run tauri build --';
|
||||
|
||||
// Use temporary config directory to avoid modifying source files
|
||||
const configPath = path.join(
|
||||
'src-tauri',
|
||||
'.pake',
|
||||
'tauri.conf.json',
|
||||
);
|
||||
let fullCommand = `${baseCommand} --target universal-apple-darwin -c "${configPath}"`;
|
||||
|
||||
// Add features
|
||||
const features = ['cli-build'];
|
||||
|
||||
// Add macos-proxy feature for modern macOS (Darwin 23+ = macOS 14+)
|
||||
const macOSVersion = this.getMacOSMajorVersion();
|
||||
if (macOSVersion >= 23) {
|
||||
features.push('macos-proxy');
|
||||
}
|
||||
|
||||
if (features.length > 0) {
|
||||
fullCommand += ` --features ${features.join(',')}`;
|
||||
}
|
||||
|
||||
return fullCommand;
|
||||
}
|
||||
return super.getBuildCommand();
|
||||
}
|
||||
|
||||
protected getBasePath(): string {
|
||||
|
||||
16
bin/helpers/tauriConfig.ts
vendored
16
bin/helpers/tauriConfig.ts
vendored
@@ -1,8 +1,14 @@
|
||||
import pakeConf from '../../src-tauri/pake.json';
|
||||
import CommonConf from '../../src-tauri/tauri.conf.json';
|
||||
import WinConf from '../../src-tauri/tauri.windows.conf.json';
|
||||
import MacConf from '../../src-tauri/tauri.macos.conf.json';
|
||||
import LinuxConf from '../../src-tauri/tauri.linux.conf.json';
|
||||
import path from 'path';
|
||||
import fsExtra from 'fs-extra';
|
||||
import { npmDirectory } from '@/utils/dir';
|
||||
|
||||
// Load configs from npm package directory, not from project source
|
||||
const tauriSrcDir = path.join(npmDirectory, 'src-tauri');
|
||||
const pakeConf = fsExtra.readJSONSync(path.join(tauriSrcDir, 'pake.json'));
|
||||
const CommonConf = fsExtra.readJSONSync(path.join(tauriSrcDir, 'tauri.conf.json'));
|
||||
const WinConf = fsExtra.readJSONSync(path.join(tauriSrcDir, 'tauri.windows.conf.json'));
|
||||
const MacConf = fsExtra.readJSONSync(path.join(tauriSrcDir, 'tauri.macos.conf.json'));
|
||||
const LinuxConf = fsExtra.readJSONSync(path.join(tauriSrcDir, 'tauri.linux.conf.json'));
|
||||
|
||||
const platformConfigs = {
|
||||
win32: WinConf,
|
||||
|
||||
Reference in New Issue
Block a user