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