mirror of
https://github.com/game-ci/unity-builder.git
synced 2026-02-03 23:49:08 +08:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c55fc4eecd | ||
|
|
4e59bb0d2a | ||
|
|
5952e3d2f6 |
2
dist/index.js
vendored
2
dist/index.js
vendored
File diff suppressed because one or more lines are too long
@@ -8,11 +8,11 @@ const core = require('@actions/core');
|
|||||||
async function action() {
|
async function action() {
|
||||||
Action.checkCompatibility();
|
Action.checkCompatibility();
|
||||||
|
|
||||||
const { dockerfile, workspace } = Action;
|
const { dockerfile, workspace, rootFolder } = Action;
|
||||||
const { version, platform, projectPath, buildName, buildsPath, method } = Input.getFromUser();
|
const { version, platform, projectPath, buildName, buildsPath, method } = Input.getFromUser();
|
||||||
|
|
||||||
const baseImage = new ImageTag({ version, platform });
|
const baseImage = new ImageTag({ version, platform });
|
||||||
const builtImage = await Docker.build({ path: workspace, dockerfile, baseImage });
|
const builtImage = await Docker.build({ path: rootFolder, dockerfile, baseImage });
|
||||||
|
|
||||||
await Docker.run(builtImage, { workspace, platform, projectPath, buildName, buildsPath, method });
|
await Docker.run(builtImage, { workspace, platform, projectPath, buildName, buildsPath, method });
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ export default class Action {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static get isRunningFromSource() {
|
static get isRunningFromSource() {
|
||||||
return __dirname !== 'dist';
|
return path.basename(__dirname) === 'model';
|
||||||
}
|
}
|
||||||
|
|
||||||
static get name() {
|
static get name() {
|
||||||
@@ -18,11 +18,6 @@ export default class Action {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static get rootFolder() {
|
static get rootFolder() {
|
||||||
if (!Action.isRunningLocally) {
|
|
||||||
const workspace = process.env.RUNNER_WORKSPACE;
|
|
||||||
return `${workspace}/${path.basename(workspace)}`;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (Action.isRunningFromSource) {
|
if (Action.isRunningFromSource) {
|
||||||
return path.dirname(path.dirname(path.dirname(__filename)));
|
return path.dirname(path.dirname(path.dirname(__filename)));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user