🐛 Remove the packaged all in Linux, add rpm.

This commit is contained in:
Tw93
2025-01-06 19:33:27 +08:00
parent 722a8b1c46
commit 4972d798b5
5 changed files with 22 additions and 11 deletions

View File

@@ -7,17 +7,28 @@ export default class LinuxBuilder extends BaseBuilder {
super(options);
}
getFileName(): string {
const { name } = this.options;
const arch = process.arch === 'x64' ? 'amd64' : process.arch;
return `${name}_${tauriConfig.version}_${arch}`;
getFileName() {
const { name, targets } = this.options;
const version = tauriConfig.version;
let arch = process.arch === 'x64' ? 'amd64' : process.arch;
if (arch === 'arm64' && (targets === 'rpm' || targets === 'appimage')) {
arch = 'aarch64';
}
// The RPM format uses different separators and version number formats
if (targets === 'rpm') {
return `${name}-${version}-1.${arch}`;
}
return `${name}_${version}_${arch}`;
}
// Customize it, considering that there are all targets.
async build(url: string) {
const targetTypes = ['deb', 'appimage'];
const targetTypes = ['deb', 'appimage', 'rpm'];
for (const target of targetTypes) {
if (this.options.targets === target || this.options.targets === 'all') {
if (this.options.targets === target) {
await this.buildAndCopy(url, target);
}
}