add support for debug builds

This commit is contained in:
Jonas Kruckenberg 2022-05-07 13:07:38 +02:00
parent 81ef53b03b
commit 9133a3c917
No known key found for this signature in database
GPG Key ID: 21AD3B3C266BDE3D
5 changed files with 16 additions and 7 deletions

View File

@ -15,6 +15,9 @@ inputs:
default: 'tauri.conf.json'
target:
description: 'The target triple to build against'
debug:
description: 'Builds with the debug flag'
default: 'false'
outputs:
artifacts:
description: ''

8
dist/index.js generated vendored
View File

@ -35,9 +35,10 @@ function buildProject(options) {
args.push('--target', options.target);
}
yield (0, execa_1.execa)(runner, args, { cwd: projectPath });
const profile = options.debug ? 'debug' : 'release';
const outDir = options.target
? `./target/${options.target}/release/bundle`
: `./target/release/bundle`;
? `./target/${options.target}/${profile}/bundle`
: `./target/${profile}/bundle`;
const macOSExts = ['app', 'app.tar.gz', 'app.tar.gz.sig', 'dmg'];
const linuxExts = [
'AppImage',
@ -106,7 +107,8 @@ function run() {
args: (0, string_argv_1.default)(core.getInput('args')),
projectPath: core.getInput('projectPath'),
configPath: core.getInput('configPath'),
target: core.getInput('target')
target: core.getInput('target'),
debug: core.getBooleanInput('debug')
});
core.setOutput('artifacts', artifacts.join('\n'));
}

2
dist/index.js.map generated vendored

File diff suppressed because one or more lines are too long

View File

@ -6,6 +6,7 @@ interface BuildOptions {
runner?: string
projectPath?: string
configPath?: string
debug?: boolean
args?: string[]
target?: string
}
@ -25,9 +26,11 @@ export async function buildProject(options: BuildOptions): Promise<string[]> {
await execa(runner, args, {cwd: projectPath})
const profile = options.debug ? 'debug' : 'release'
const outDir = options.target
? `./target/${options.target}/release/bundle`
: `./target/release/bundle`
? `./target/${options.target}/${profile}/bundle`
: `./target/${profile}/bundle`
const macOSExts = ['app', 'app.tar.gz', 'app.tar.gz.sig', 'dmg']
const linuxExts = [
'AppImage',

View File

@ -9,7 +9,8 @@ async function run(): Promise<void> {
args: stringArgv(core.getInput('args')),
projectPath: core.getInput('projectPath'),
configPath: core.getInput('configPath'),
target: core.getInput('target')
target: core.getInput('target'),
debug: core.getBooleanInput('debug')
})
core.setOutput('artifacts', artifacts.join('\n'))