* Add intial framework for macos builds. Test install editor * Fix unity hub path space * Single quote space in path * Escape space character * More backslashes * Move to bash scripts for setup * Add path to command args * Different command to run shell script * Use full path to scripts * Unpack changeset value and fix missing escape characters * Print changeset * More debug * Remove debug * Fix script paths * Printenv debug * Write environment variables to file to read in bash script * Debug file write * More debug * Fix missing await * Move back to process.env * Fix path typo * Add missing flags * Make directory for license activation * Add missing sudo * Give permissions to license folder * Fix path issues * Add build tests * Try ts setup again * Try quoting path * Further migrate mac scripts to align with linux scripts * print pwd * Fix changeset and remove unneeded env vars * Ignore return code * fix missing current directory * Fix project path * pwd * Remove project path * Revert to cwd being the workspace folder and pass action folder as an env variable. * Add blank project to use for activation * Add blank project path * Fix build tests * Don't rebuild library on windows * Fix project path windows * Fix platform specific workspace env variable * Fix incorrect variable name * Update .github/workflows/mac-build-tests.yml Co-authored-by: Webber Takken <webber.nl@gmail.com> * Update .github/workflows/mac-build-tests.yml Co-authored-by: Webber Takken <webber.nl@gmail.com> * Update dist/BlankProject/Packages/packages-lock.json Co-authored-by: Webber Takken <webber.nl@gmail.com> * Update src/model/platform-setup/setup-mac.ts Co-authored-by: Webber Takken <webber.nl@gmail.com> * Update src/model/platform-setup/setup-mac.ts Co-authored-by: Webber Takken <webber.nl@gmail.com> * Fix formatting Co-authored-by: Webber Takken <webber.nl@gmail.com>
47 lines
1.4 KiB
TypeScript
47 lines
1.4 KiB
TypeScript
import * as core from '@actions/core';
|
|
import { Action, BuildParameters, Cache, Docker, ImageTag, Output, CloudRunner } from './model';
|
|
import { CLI } from './model/cli/cli';
|
|
import MacBuilder from './model/mac-builder';
|
|
import PlatformSetup from './model/platform-setup';
|
|
async function runMain() {
|
|
try {
|
|
Action.checkCompatibility();
|
|
Cache.verify();
|
|
|
|
const { dockerfile, workspace, actionFolder } = Action;
|
|
|
|
const buildParameters = await BuildParameters.create();
|
|
const baseImage = new ImageTag(buildParameters);
|
|
|
|
let builtImage;
|
|
|
|
if (
|
|
buildParameters.cloudRunnerCluster &&
|
|
buildParameters.cloudRunnerCluster !== '' &&
|
|
buildParameters.cloudRunnerCluster !== 'local'
|
|
) {
|
|
await CloudRunner.run(buildParameters, baseImage.toString());
|
|
} else {
|
|
core.info('Building locally');
|
|
await PlatformSetup.setup(buildParameters, actionFolder);
|
|
if (process.platform === 'darwin') {
|
|
MacBuilder.run(actionFolder, workspace, buildParameters);
|
|
} else {
|
|
builtImage = await Docker.build({ path: actionFolder, dockerfile, baseImage });
|
|
await Docker.run(builtImage, { workspace, ...buildParameters });
|
|
}
|
|
}
|
|
|
|
// Set output
|
|
await Output.setBuildVersion(buildParameters.buildVersion);
|
|
} catch (error) {
|
|
core.setFailed((error as Error).message);
|
|
}
|
|
}
|
|
const options = CLI.SetupCli();
|
|
if (CLI.isCliMode(options)) {
|
|
CLI.RunCli(options);
|
|
} else {
|
|
runMain();
|
|
}
|