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' default: 'tauri.conf.json'
target: target:
description: 'The target triple to build against' description: 'The target triple to build against'
debug:
description: 'Builds with the debug flag'
default: 'false'
outputs: outputs:
artifacts: artifacts:
description: '' description: ''

8
dist/index.js generated vendored
View File

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

View File

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