feat: Add includeRelease option to allow for disabling release builds (#365)

* Add options for disabling release builds

* Update readme

* Set includeRelease to true by default

* rebuild dist

* add changefile

---------

Co-authored-by: FabianLars <fabianlars@fabianlars.de>
This commit is contained in:
Raphii
2023-02-06 15:11:08 +01:00
committed by GitHub
parent aab18d7993
commit 5ae9606989
5 changed files with 18 additions and 4 deletions

View File

@@ -0,0 +1,5 @@
---
'action': patch
---
Add `includeRelease` option to allow disabling release builds.

View File

@@ -195,7 +195,8 @@ jobs:
| `prerelease` | false | Whether the release to create is a prerelease or not | bool | false |
| `releaseCommitish` | false | Any branch or commit SHA the Git tag is created from, unused if the Git tag already exists | string | SHA of current commit |
| `iconPath` | false | path to the PNG icon to use as app icon, relative to the projectPath | string | |
| `includeDebug` | false | whether to include a debug build or not | bool | |
| `includeDebug` | false | whether to include a debug build or not | bool | false |
| `includeRelease` | false | whether to include a release build or not | bool | true |
| `tauriScript` | false | the script to execute the Tauri CLI | string | `yarn\|npx tauri` |
| `args` | false | Additional arguments to the current build command | string | |

View File

@@ -33,6 +33,9 @@ inputs:
includeDebug:
description: 'whether to include a debug build or not'
default: false
includeRelease:
description: 'whether to include a release build or not'
default: true
tauriScript:
description: 'the script to run to build the Tauri app'
args:

2
dist/index.js vendored

File diff suppressed because one or more lines are too long

View File

@@ -11,7 +11,7 @@ import { uploadVersionJSON } from './upload-version-json';
import { buildProject } from './build';
import { execCommand, getInfo, getPackageJson } from './utils';
import type { BuildOptions } from './types';
import type { Artifact, BuildOptions } from './types';
async function run(): Promise<void> {
try {
@@ -25,6 +25,7 @@ async function run(): Promise<void> {
);
const distPath = core.getInput('distPath');
const iconPath = core.getInput('iconPath');
const includeRelease = core.getBooleanInput('includeRelease');
const includeDebug = core.getBooleanInput('includeDebug');
const tauriScript = core.getInput('tauriScript');
const args = stringArgv(core.getInput('args'));
@@ -55,7 +56,11 @@ async function run(): Promise<void> {
bundleIdentifier,
};
const info = getInfo(projectPath);
const artifacts = await buildProject(projectPath, false, options);
const artifacts: Artifact[] = [];
if (includeRelease) {
const releaseArtifacts = await buildProject(projectPath, false, options);
artifacts.push(...releaseArtifacts);
}
if (includeDebug) {
const debugArtifacts = await buildProject(projectPath, true, options);
artifacts.push(...debugArtifacts);