mirror of
https://github.com/game-ci/unity-builder.git
synced 2025-07-04 12:25:19 -04:00
Rename builder folder to action folder (unity actions convention)
This commit is contained in:
parent
d8896dc4f5
commit
f3a984165e
@ -2,4 +2,4 @@
|
||||
*
|
||||
|
||||
# Files required for the action
|
||||
!builder/
|
||||
!action/
|
||||
|
@ -1,2 +1,2 @@
|
||||
**/node_modules/**
|
||||
**/builder/**
|
||||
**/action/**
|
||||
|
6
.github/workflows/main.yml
vendored
6
.github/workflows/main.yml
vendored
@ -12,7 +12,7 @@ jobs:
|
||||
name: Tests
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: 12.x
|
||||
@ -48,7 +48,9 @@ jobs:
|
||||
# - Switch # Build a Nintendo Switch player.
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
lfs: true
|
||||
- uses: actions/cache@v1.1.0
|
||||
with:
|
||||
path: ${{ matrix.projectPath }}/Library
|
||||
|
@ -1,2 +1,2 @@
|
||||
**/node_modules/**
|
||||
**/dist/**
|
||||
**/action/**
|
||||
|
@ -122,7 +122,7 @@ Example:
|
||||
Library-
|
||||
```
|
||||
|
||||
This simple could speed up your build by more than 50%.
|
||||
This simple addition could speed up your build by more than 50%.
|
||||
|
||||
## Complete example
|
||||
|
||||
@ -164,7 +164,9 @@ jobs:
|
||||
- tvOS # Build to Apple's tvOS platform.
|
||||
- Switch # Build a Nintendo Switch player.
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
lfs: true
|
||||
- uses: actions/cache@v1.1.0
|
||||
with:
|
||||
path: ${{ matrix.projectPath }}/Library
|
||||
|
@ -32,4 +32,4 @@ branding:
|
||||
color: 'gray-dark'
|
||||
runs:
|
||||
using: 'node12'
|
||||
main: 'builder/index.js'
|
||||
main: 'action/index.js'
|
||||
|
1
action/index.js
Normal file
1
action/index.js
Normal file
File diff suppressed because one or more lines are too long
@ -4,7 +4,7 @@
|
||||
# Set project path
|
||||
#
|
||||
|
||||
UNITY_PROJECT_PATH="$GITHUB_WORKSPACE/$PROJECT_PATH"
|
||||
UNITY_PROJECT_PATH="$GITHUB_WORKSPACE/$PROJECT_PATH/"
|
||||
echo "Using project path \"$UNITY_PROJECT_PATH\"."
|
||||
|
||||
#
|
File diff suppressed because one or more lines are too long
@ -2,12 +2,12 @@
|
||||
"name": "unity-builder",
|
||||
"version": "0.5.0",
|
||||
"description": "Build Unity projects for different platforms.",
|
||||
"main": "builder/index.js",
|
||||
"main": "action/index.js",
|
||||
"repository": "git@github.com:webbertakken/unity-builder.git",
|
||||
"author": "Webber <webber@takken.io>",
|
||||
"license": "MIT",
|
||||
"scripts": {
|
||||
"build": "ncc build src --out builder --minify",
|
||||
"build": "ncc build src --out action --minify",
|
||||
"lint": "prettier --check \"src/**/*.js\" && eslint src",
|
||||
"test": "jest"
|
||||
},
|
||||
@ -39,7 +39,7 @@
|
||||
},
|
||||
"husky": {
|
||||
"hooks": {
|
||||
"pre-commit": "lint-staged && yarn build && git add builder/index.js"
|
||||
"pre-commit": "lint-staged && yarn build && git add action/index.js"
|
||||
}
|
||||
},
|
||||
"lint-staged": {
|
||||
|
@ -6,12 +6,12 @@ async function action() {
|
||||
Action.checkCompatibility();
|
||||
Cache.verify();
|
||||
|
||||
const { dockerfile, workspace, builderFolder } = Action;
|
||||
const { dockerfile, workspace, actionFolder } = Action;
|
||||
const buildParameters = BuildParameters.create(Input.getFromUser());
|
||||
const baseImage = new ImageTag(buildParameters);
|
||||
|
||||
// Build docker image
|
||||
const builtImage = await Docker.build({ path: builderFolder, dockerfile, baseImage });
|
||||
const builtImage = await Docker.build({ path: actionFolder, dockerfile, baseImage });
|
||||
|
||||
// Run docker image
|
||||
await Docker.run(builtImage, { workspace, ...buildParameters });
|
||||
|
@ -25,12 +25,12 @@ class Action {
|
||||
return path.dirname(path.dirname(__filename));
|
||||
}
|
||||
|
||||
static get builderFolder() {
|
||||
return `${Action.rootFolder}/builder`;
|
||||
static get actionFolder() {
|
||||
return `${Action.rootFolder}/action`;
|
||||
}
|
||||
|
||||
static get dockerfile() {
|
||||
return `${Action.builderFolder}/Dockerfile`;
|
||||
return `${Action.actionFolder}/Dockerfile`;
|
||||
}
|
||||
|
||||
static get workspace() {
|
||||
|
@ -20,11 +20,11 @@ describe('Action', () => {
|
||||
expect(fs.existsSync(rootFolder)).toStrictEqual(true);
|
||||
});
|
||||
|
||||
it('returns the builder folder', () => {
|
||||
const { builderFolder } = Action;
|
||||
it('returns the action folder', () => {
|
||||
const { actionFolder } = Action;
|
||||
|
||||
expect(path.basename(builderFolder)).toStrictEqual('builder');
|
||||
expect(fs.existsSync(builderFolder)).toStrictEqual(true);
|
||||
expect(path.basename(actionFolder)).toStrictEqual('action');
|
||||
expect(fs.existsSync(actionFolder)).toStrictEqual(true);
|
||||
});
|
||||
|
||||
it('returns the docker file', () => {
|
||||
|
@ -4,7 +4,7 @@ import ImageTag from './image-tag';
|
||||
|
||||
describe('Docker', () => {
|
||||
it('builds', async () => {
|
||||
const path = Action.builderFolder;
|
||||
const path = Action.actionFolder;
|
||||
const dockerfile = `${path}/Dockerfile`;
|
||||
const baseImage = new ImageTag({
|
||||
repository: '',
|
||||
|
Loading…
Reference in New Issue
Block a user