mirror of
https://github.com/game-ci/unity-builder.git
synced 2025-07-04 12:25:19 -04:00

* Refactor to typescript (config part) * Refactor to typescript (convert extensions, minor fixes) * Refactor to typescript (move from `action` to `dist`) * Re-enable integrity-check for dist index.js * Fix all tests and lints * fix parsing major versions * Test patch level to be digits only * debug * debug * uncache * manual compile * debug * debug * Debug * Build lib - doh * remove diff check * Make kubernetes workflow manual * Properly generate 3 digit for simple major tags * Remove ts-ignore * re-enable cache
31 lines
1.0 KiB
TypeScript
31 lines
1.0 KiB
TypeScript
import * as core from '@actions/core';
|
|
import { Action, BuildParameters, Cache, Docker, ImageTag, Kubernetes, Output } from './model';
|
|
|
|
async function run() {
|
|
try {
|
|
Action.checkCompatibility();
|
|
Cache.verify();
|
|
|
|
const { dockerfile, workspace, actionFolder } = Action;
|
|
|
|
const buildParameters = await BuildParameters.create();
|
|
const baseImage = new ImageTag(buildParameters);
|
|
if (buildParameters.kubeConfig) {
|
|
core.info('Building with Kubernetes');
|
|
await Kubernetes.runBuildJob(buildParameters, baseImage);
|
|
} else {
|
|
// Build docker image
|
|
// TODO: No image required (instead use a version published to dockerhub for the action, supply credentials for github cloning)
|
|
const 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.message);
|
|
}
|
|
}
|
|
|
|
run();
|