Skip to content

Commit

Permalink
fix: Only look for unzipped bundles when not using v1Compatible (#908)
Browse files Browse the repository at this point in the history
  • Loading branch information
FabianLars authored Sep 11, 2024
1 parent 18cbb1a commit 9387d95
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changes/v1compatible.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
action: patch
---

The action will now only use the signature file for unzipped bundles if `createUpdaterArtifacts` in tauri.conf.json is set to `true`.
2 changes: 1 addition & 1 deletion dist/index.js

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ export class TauriConfig {
beforeBuildCommand?: string;
rpmRelease?: string;
wixLanguage?: string | string[] | { [language: string]: unknown };
unzippedSigs?: boolean;

constructor(identifier: string, isV2 = false) {
this.identifier = identifier;
Expand Down Expand Up @@ -212,6 +213,7 @@ export class TauriConfig {
c.beforeBuildCommand = config.build?.beforeBuildCommand;
c.rpmRelease = config.bundle?.linux?.rpm?.release;
c.wixLanguage = config.bundle?.windows?.wix?.language;
c.unzippedSigs = config.bundle?.createUpdaterArtifacts === true;

return c;
}
Expand All @@ -228,6 +230,10 @@ export class TauriConfig {
c.build?.beforeBuildCommand ?? this.beforeBuildCommand;
this.rpmRelease = c.bundle?.linux?.rpm?.release ?? this.rpmRelease;
this.wixLanguage = c.bundle?.windows?.wix?.language ?? this.wixLanguage;
this.unzippedSigs =
c.bundle?.createUpdaterArtifacts != null
? c.bundle?.createUpdaterArtifacts === true
: this.unzippedSigs;
} else {
const c = config as TauriConfigV1;

Expand Down
1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ async function run(): Promise<void> {
artifacts:
releaseArtifacts.length !== 0 ? releaseArtifacts : debugArtifacts,
targetInfo,
unzippedSig: info.unzippedSigs,
updaterJsonPreferNsis,
updaterJsonKeepUniversal,
});
Expand Down
2 changes: 2 additions & 0 deletions src/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ export interface Info {
wixLanguage: string | string[] | { [language: string]: unknown };
wixAppVersion: string;
rpmRelease: string;
unzippedSigs: boolean;
}

export type TargetPlatform = 'android' | 'ios' | 'macos' | 'linux' | 'windows';
Expand Down Expand Up @@ -84,6 +85,7 @@ export interface TauriConfigV2 {
beforeBuildCommand?: string;
};
bundle?: {
createUpdaterArtifacts?: boolean | 'v1Compatible';
linux?: {
rpm?: {
release?: string;
Expand Down
10 changes: 8 additions & 2 deletions src/upload-version-json.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export async function uploadVersionJSON({
releaseId,
artifacts,
targetInfo,
unzippedSig,
updaterJsonPreferNsis,
updaterJsonKeepUniversal,
}: {
Expand All @@ -42,6 +43,7 @@ export async function uploadVersionJSON({
releaseId: number;
artifacts: Artifact[];
targetInfo: TargetInfo;
unzippedSig: boolean;
updaterJsonPreferNsis: boolean;
updaterJsonKeepUniversal: boolean;
}) {
Expand Down Expand Up @@ -120,8 +122,12 @@ export async function uploadVersionJSON({
});
function signaturePriority(signaturePath: string) {
const priorities = updaterJsonPreferNsis
? ['.nsis.zip.sig', '.exe.sig', '.msi.zip.sig', '.msi.sig']
: ['.msi.zip.sig', '.msi.sig', '.nsis.zip.sig', '.exe.sig'];
? unzippedSig
? ['.exe.sig', '.msi.sig']
: ['.nsis.zip.sig', '.msi.zip.sig']
: unzippedSig
? ['.msi.sig', '.exe.sig']
: ['.msi.zip.sig', '.nsis.zip.sig'];
for (const [index, extension] of priorities.entries()) {
if (signaturePath.endsWith(extension)) {
return 100 - index;
Expand Down
1 change: 1 addition & 0 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,7 @@ export function getInfo(
wixLanguage,
wixAppVersion,
rpmRelease,
unzippedSigs: config.unzippedSigs === true,
};
} else {
// This should not actually happen.
Expand Down

0 comments on commit 9387d95

Please sign in to comment.