Skip to content

Commit

Permalink
fix: Prefer release builds for latest.json (#499)
Browse files Browse the repository at this point in the history
* fix: Prefer release builds for latest.json

* rebuild dist
  • Loading branch information
FabianLars committed Jun 16, 2023
1 parent 086c054 commit 8e6f88e
Show file tree
Hide file tree
Showing 5 changed files with 69 additions and 31 deletions.
5 changes: 5 additions & 0 deletions .changes/fix-prefer-release-for-updater.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
action: patch:bug
---

The action now prefers release builds for the latest.json file if both, release and debug releases are enabled.
2 changes: 1 addition & 1 deletion dist/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"eslint-config-prettier": "8.8.0",
"eslint-config-standard-with-typescript": "35.0.0",
"eslint-plugin-import": "2.27.5",
"eslint-plugin-n": "16.0.0",
"eslint-plugin-n": "15.7.0",
"eslint-plugin-promise": "6.1.1",
"prettier": "2.8.8",
"typescript": "5.1.3"
Expand Down
72 changes: 52 additions & 20 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 10 additions & 9 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,7 @@ async function run(): Promise<void> {
// TODO: Change its default to true for v2 apps
// Not using getBooleanInput so we can differentiate between true,false,unset later.
const updaterJsonPreferNsis =
core.getInput('updaterJsonPreferNsis')?.toLowerCase() === 'true'
? true
: false;
core.getInput('updaterJsonPreferNsis')?.toLowerCase() === 'true';

if (!releaseId) {
if (Boolean(tagName) !== Boolean(releaseName)) {
Expand Down Expand Up @@ -79,15 +77,17 @@ async function run(): Promise<void> {
const targetInfo = getTargetInfo(targetPath);
const info = getInfo(projectPath, targetInfo, configArg);

const artifacts: Artifact[] = [];
const releaseArtifacts: Artifact[] = [];
const debugArtifacts: Artifact[] = [];
if (includeRelease) {
const releaseArtifacts = await buildProject(projectPath, false, options);
artifacts.push(...releaseArtifacts);
releaseArtifacts.push(
...(await buildProject(projectPath, false, options))
);
}
if (includeDebug) {
const debugArtifacts = await buildProject(projectPath, true, options);
artifacts.push(...debugArtifacts);
debugArtifacts.push(...(await buildProject(projectPath, true, options)));
}
const artifacts = releaseArtifacts.concat(debugArtifacts);

if (artifacts.length === 0) {
throw new Error('No artifacts were found.');
Expand Down Expand Up @@ -167,7 +167,8 @@ async function run(): Promise<void> {
notes: body,
tagName,
releaseId,
artifacts,
artifacts:
releaseArtifacts.length !== 0 ? releaseArtifacts : debugArtifacts,
targetInfo,
updaterJsonPreferNsis,
updaterJsonKeepUniversal,
Expand Down

0 comments on commit 8e6f88e

Please sign in to comment.