Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add support for RPM bundle artifacts #651

Merged
merged 1 commit into from
Jan 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changes/rpm-support.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
action: 'patch'
---

Add support for RPM bundle artifacts, introduced in tauri-bundler@2.0.0-alpha.14
2 changes: 1 addition & 1 deletion dist/index.js

Large diffs are not rendered by default.

16 changes: 16 additions & 0 deletions src/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ export async function buildProject(
name: info.name,
version: info.version,
wixLanguage: info.wixLanguage,
rpmRelease: info.rpmRelease,
};

await runner.execTauriCommand(['build'], [...tauriArgs], root);
Expand Down Expand Up @@ -175,6 +176,14 @@ export async function buildProject(
: arch === 'aarch64'
? 'arm64'
: arch;
const rpmArch =
arch === 'x64' || arch === 'x86_64'
? 'x86_64'
: arch === 'x32' || arch === 'x86' || arch === 'i686'
? 'i386'
: arch === 'arm'
? 'armhfp'
: arch;
const appImageArch =
arch === 'x64' || arch === 'x86_64'
? 'amd64'
Expand All @@ -190,6 +199,13 @@ export async function buildProject(
),
arch: debianArch,
},
{
path: join(
artifactsPath,
`bundle/rpm/${fileAppName}-${app.version}-${app.rpmRelease}.${rpmArch}.rpm`,
),
arch: rpmArch,
},
{
path: join(
artifactsPath,
Expand Down
4 changes: 4 additions & 0 deletions src/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ export interface Info {
name: string;
version: string;
wixLanguage: string | string[] | { [language: string]: unknown };
rpmRelease: string;
}

export type TargetPlatform = 'android' | 'ios' | 'macos' | 'linux' | 'windows';
Expand All @@ -61,6 +62,9 @@ export interface TauriConfig {
tauri?: {
bundle?: {
identifier: string;
rpm?: {
release?: string;
};
windows?: {
wix?: {
language?: string | string[] | { [language: string]: unknown };
Expand Down
7 changes: 7 additions & 0 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export const extensions = [
'.AppImage.tar.gz',
'.AppImage',
'.deb',
'.rpm',
'.msi.zip.sig',
'.msi.zip',
'.msi',
Expand Down Expand Up @@ -266,6 +267,7 @@ export function getInfo(
let version;
let wixLanguage: string | string[] | { [language: string]: unknown } =
'en-US';
let rpmRelease = '1';

const config = getConfig(tauriDir);
if (targetInfo) {
Expand Down Expand Up @@ -298,11 +300,16 @@ export function getInfo(
process.exit(1);
}

if (config.tauri?.bundle?.rpm?.release) {
rpmRelease = config.tauri?.bundle?.rpm?.release;
}

return {
tauriPath: tauriDir,
name,
version,
wixLanguage,
rpmRelease,
};
} else {
// This should not actually happen.
Expand Down
Loading