🐛 Remove the packaged all in Linux, add rpm.
This commit is contained in:
2
.github/workflows/pake-cli.yaml
vendored
2
.github/workflows/pake-cli.yaml
vendored
@@ -51,7 +51,7 @@ on:
|
||||
options:
|
||||
- 'deb'
|
||||
- 'appimage'
|
||||
- 'all'
|
||||
- 'rpm'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
2
bin/README.md
vendored
2
bin/README.md
vendored
@@ -178,7 +178,7 @@ Package the application to support both Intel and M1 chips, exclusively for macO
|
||||
|
||||
#### [targets]
|
||||
|
||||
Select the output package format for Linux. Options include `deb`, `appimage`, or `all`. If `all` is selected, both `deb` and `appimage` will be packaged. Default is `deb`.
|
||||
Choose the output package format, supporting `deb`, `appimage`, `rpm`, This option is only applicable to Linux and defaults to `deb`.
|
||||
|
||||
```shell
|
||||
--targets <format>
|
||||
|
||||
2
bin/README_CN.md
vendored
2
bin/README_CN.md
vendored
@@ -178,7 +178,7 @@ pake [url] [options]
|
||||
|
||||
#### [targets]
|
||||
|
||||
选择输出的包格式,支持 `deb`、`appimage` 或 `all`,如果选择 `all`,则会同时打包 `deb` 和 `appimage`,此选项仅适用于 Linux,默认为 `deb`。
|
||||
选择输出的包格式,支持 `deb`、`appimage`、`rpm`,此选项仅适用于 Linux,默认为 `deb`。
|
||||
|
||||
```shell
|
||||
--targets <string>
|
||||
|
||||
23
bin/builders/LinuxBuilder.ts
vendored
23
bin/builders/LinuxBuilder.ts
vendored
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
4
bin/helpers/merge.ts
vendored
4
bin/helpers/merge.ts
vendored
@@ -101,9 +101,9 @@ export async function mergeConfig(url: string, options: PakeAppOptions, tauriCon
|
||||
// Processing targets are currently only open to Linux.
|
||||
if (platform === 'linux') {
|
||||
delete tauriConf.bundle.linux.deb.files;
|
||||
const validTargets = ['all', 'deb', 'appimage', 'rpm'];
|
||||
const validTargets = ['deb', 'appimage', 'rpm'];
|
||||
if (validTargets.includes(options.targets)) {
|
||||
tauriConf.bundle.targets = options.targets === 'all' ? ['deb', 'appimage', 'rpm'] : [options.targets];
|
||||
tauriConf.bundle.targets = [options.targets];
|
||||
} else {
|
||||
logger.warn(`✼ The target must be one of ${validTargets.join(', ')}, the default 'deb' will be used.`);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user