Skip to content

Commit

Permalink
fix: Fixed MSI build version inconsistency (#684)
Browse files Browse the repository at this point in the history
* fix: Fixed MSI build version inconsistency

* chore: Added the change to the list

* chore: Added WixAppVersion type

* chore: run builder

* chore: format error fixed
  • Loading branch information
BarraR3port committed Jan 20, 2024
1 parent d2b1e11 commit 0ae6017
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .changes/fix-version-inconsistency.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
action: 'patch'
---

The action now correctly handles the wix version after the build of the app in case the version includes a `+` or `-` character.
2 changes: 1 addition & 1 deletion dist/index.js

Large diffs are not rendered by default.

7 changes: 4 additions & 3 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,
wixAppVersion: info.wixAppVersion,
rpmRelease: info.rpmRelease,
};

Expand Down Expand Up @@ -128,19 +129,19 @@ export async function buildProject(
winArtifacts.push(
join(
artifactsPath,
`bundle/msi/${fileAppName}_${app.version}_${arch}_${lang}.msi`,
`bundle/msi/${fileAppName}_${app.wixAppVersion}_${arch}_${lang}.msi`,
),
);
winArtifacts.push(
join(
artifactsPath,
`bundle/msi/${fileAppName}_${app.version}_${arch}_${lang}.msi.zip`,
`bundle/msi/${fileAppName}_${app.wixAppVersion}_${arch}_${lang}.msi.zip`,
),
);
winArtifacts.push(
join(
artifactsPath,
`bundle/msi/${fileAppName}_${app.version}_${arch}_${lang}.msi.zip.sig`,
`bundle/msi/${fileAppName}_${app.wixAppVersion}_${arch}_${lang}.msi.zip.sig`,
),
);
});
Expand Down
1 change: 1 addition & 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 };
wixAppVersion: string;
rpmRelease: string;
}

Expand Down
6 changes: 6 additions & 0 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,7 @@ export function getInfo(
let version;
let wixLanguage: string | string[] | { [language: string]: unknown } =
'en-US';
let wixAppVersion;
let rpmRelease = '1';

const config = getConfig(tauriDir);
Expand Down Expand Up @@ -300,6 +301,10 @@ export function getInfo(
process.exit(1);
}

if (version) {
wixAppVersion = version.replace(/[-+]/g, '.');
}

if (config.tauri?.bundle?.rpm?.release) {
rpmRelease = config.tauri?.bundle?.rpm?.release;
}
Expand All @@ -309,6 +314,7 @@ export function getInfo(
name,
version,
wixLanguage,
wixAppVersion,
rpmRelease,
};
} else {
Expand Down

0 comments on commit 0ae6017

Please sign in to comment.