Skip to content

Commit

Permalink
Rename builder folder to action folder (unity actions convention)
Browse files Browse the repository at this point in the history
  • Loading branch information
webbertakken committed Feb 1, 2020
1 parent d8896dc commit f3a9841
Show file tree
Hide file tree
Showing 43 changed files with 27 additions and 23 deletions.
2 changes: 1 addition & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
*

# Files required for the action
!builder/
!action/
2 changes: 1 addition & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
**/node_modules/**
**/builder/**
**/action/**
6 changes: 4 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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/[email protected]
with:
path: ${{ matrix.projectPath }}/Library
Expand Down
2 changes: 1 addition & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
**/node_modules/**
**/dist/**
**/action/**
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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/[email protected]
with:
path: ${{ matrix.projectPath }}/Library
Expand Down
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ branding:
color: 'gray-dark'
runs:
using: 'node12'
main: 'builder/index.js'
main: 'action/index.js'
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions action/index.js

Large diffs are not rendered by default.

File renamed without changes.
2 changes: 1 addition & 1 deletion builder/steps/build.sh → action/steps/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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\"."

#
Expand Down
File renamed without changes.
1 change: 0 additions & 1 deletion builder/index.js

This file was deleted.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": "[email protected]:webbertakken/unity-builder.git",
"author": "Webber <[email protected]>",
"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"
},
Expand Down Expand Up @@ -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": {
Expand Down
4 changes: 2 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 });
Expand Down
6 changes: 3 additions & 3 deletions src/model/action.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
8 changes: 4 additions & 4 deletions src/model/action.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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', () => {
Expand Down
2 changes: 1 addition & 1 deletion src/model/docker.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: '',
Expand Down

0 comments on commit f3a9841

Please sign in to comment.