fix: missing setOutput and simplify os setup

pull/413/head
Webber 2022-08-21 19:54:34 +02:00
parent 52f57c5e18
commit f4f7aba8ca
4 changed files with 7 additions and 4 deletions

View File

@ -21,8 +21,6 @@ export class BuildCommand extends CommandBase implements CommandInterface {
log.debug('baseImage', baseImage);
await PlatformSetup.setup(parameters, actionFolder);
log.info('Platform setup done.');
log.info('OS:', env.getOS());
if (env.getOS() === 'darwin') {
MacBuilder.run(actionFolder, workspace, parameters);
} else {

View File

@ -1,8 +1,10 @@
import { fsSync as fs, exec } from '../../../dependencies.ts';
import { Parameters } from '../../../model/index.ts';
import ValidateWindows from '../platform-validation/validate-windows.ts';
class SetupWindows {
public static async setup(parameters: Parameters) {
ValidateWindows.validate(parameters);
await this.generateWinSdkRegistryKey(parameters);
}

View File

@ -6,8 +6,7 @@ class PlatformSetup {
static async setup(parameters: Parameters, actionFolder: string) {
switch (process.platform) {
case 'win32':
ValidateWindows.validate(parameters);
SetupWindows.setup(parameters);
await SetupWindows.setup(parameters);
break;
case 'darwin':
await SetupMac.setup(parameters, actionFolder);

View File

@ -9,6 +9,10 @@ export const core = {
console.error(error, error.stack);
},
setOutput: (key, value) => {
console.log(`(mock) Output "${key}" is set to "${value}"`);
},
// Adapted from: https://github.com/actions/toolkit/blob/9b7bcb1567c9b7f134eb3c2d6bbf409a5106a956/packages/core/src/core.ts#L128
getInput: (name, options) => {
const variable = `INPUT_${name.replace(/ /g, '_').toUpperCase()}`;