Update documentation

This commit is contained in:
Webber 2019-12-22 22:06:34 +01:00 committed by Webber Takken
parent 3ae2ac1bb9
commit 5abc3164f9
2 changed files with 112 additions and 69 deletions

View File

@ -6,7 +6,6 @@ on:
env: env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }} UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
PROJECT_PATH: test-project
jobs: jobs:
buildForAllPlatforms: buildForAllPlatforms:
@ -15,11 +14,14 @@ jobs:
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
projectPath:
- test-project
unityVersion: unityVersion:
- 2019.2.11f1 - 2019.2.11f1
- 2019.3.0f1 # - 2019.3.0f1 # requires unity-activate to upgrade
targetPlatform: targetPlatform:
- WebGL - WebGL
- iOS
# - StandaloneOSX # - StandaloneOSX
# - StandaloneWindows # - StandaloneWindows
# - StandaloneWindows64 # - StandaloneWindows64
@ -28,7 +30,6 @@ jobs:
# - XboxOne # - XboxOne
# - Switch # - Switch
# - Android # - Android
- iOS
# - tvOS # - tvOS
# - Lumin # - Lumin
# - BJM # - BJM
@ -40,11 +41,11 @@ jobs:
steps: steps:
- uses: actions/checkout@v1 - uses: actions/checkout@v1
- uses: webbertakken/unity-activate@v1 - uses: webbertakken/unity-activate@v1
- uses: ./ # webbertakken/unity-builder@v0.3-webgl - uses: ./
with: with:
projectPath: test-project projectPath: ${{ matrix.projectPath }}
targetPlatform: ${{ matrix.targetPlatform }}
unityVersion: ${{ matrix.unityVersion }} unityVersion: ${{ matrix.unityVersion }}
targetPlatform: ${{ matrix.targetPlatform }}
- uses: webbertakken/unity-return-license@v1 - uses: webbertakken/unity-return-license@v1
if: always() if: always()
- uses: actions/upload-artifact@v1 - uses: actions/upload-artifact@v1

134
README.md
View File

@ -1,4 +1,5 @@
# Unity - Builder # Unity - Builder
[![Actions status](https://github.com/webbertakken/unity-builder/workflows/Actions%20%F0%9F%98%8E/badge.svg)](https://github.com/webbertakken/unity-builder/actions?query=branch%3Amaster+workflow%3A%22Actions+%F0%9F%98%8E%22) [![Actions status](https://github.com/webbertakken/unity-builder/workflows/Actions%20%F0%9F%98%8E/badge.svg)](https://github.com/webbertakken/unity-builder/actions?query=branch%3Amaster+workflow%3A%22Actions+%F0%9F%98%8E%22)
--- ---
@ -36,59 +37,100 @@ Create or edit the file called `.github/workflows/main.yml` and add a job to it.
name: Build project name: Build project
on: [push] on: [push]
jobs: jobs:
buildForWebGL: buildForSomePlatforms:
name: Build for WebGL 🕸 name: Build for ${{ matrix.targetPlatform }} on version ${{ matrix.unityVersion }}
runs-on: ubuntu-latest runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
projectPath:
- path/to/your/project
unityVersion:
- 2019.2.11f1
targetPlatform:
- WebGL
- iOS
steps: steps:
``` - uses: actions/checkout@v1
- uses: webbertakken/unity-activate@v1
Activate Unity in a step using the - uses: webbertakken/unity-builder@v0.3
[Unity Activate](https://github.com/marketplace/actions/unity-activate) with:
action. projectPath: ${{ matrix.projectPath }}
unityVersion: ${{ matrix.unityVersion }}
Configure the builder as follows: targetPlatform: ${{ matrix.targetPlatform }}
- uses: webbertakken/unity-return-license@v1
```yaml if: always()
# Configure builder - uses: actions/upload-artifact@v1
- name: Build project
id: buildStep
uses: webbertakken/unity-builder@v0.2 # WIP (only webgl for now)
env:
# Optional: Path to your project, leave blank for "./"
UNITY_PROJECT_PATH: path/to/your/project
# Name for your build
BUILD_NAME: TestBuild
# Optional: Builds path, leave blank for "build"
BUILDS_PATH: build
# Target platform for your build
BUILD_TARGET: WebGL
# Optional: <StaticBuildClass.StaticMethod>
BUILD_METHOD: ""
```
> _**Note:** By default the enabled scenes from the
project's settings will be built._
You use the id to **upload your built files** like so:
```yaml
# Upload distributables
- name: Upload Build
uses: actions/upload-artifact@v1
with: with:
name: Build name: Build
path: ${{ steps.buildStep.outputs.allBuildsPath }} path: build
``` ```
Return the Unity license in a final step using the > **Notes:**
[Unity Return License](https://github.com/marketplace/actions/unity-return-license) >
action. > - Don't forget to replace _&lt;test-project&gt;_ with your project name.
> - By default the enabled scenes from the project's settings will be built.
Commit and push your workflow definition. ## Configuration options
Below options can be specified under `with:` for the `unity-builder` action.
#### projectPath
Specify the path to your Unity project to be built.
The path should be relative to the root of your project.
_**required:** `false`_
_**default:** `<your project root>`_
#### unityVersion
Version of Unity to use for building the project.
_**required:** `false`_
_**default:** `2019.2.1f11`_
#### targetPlatform
Platform that the build should target.
_**required:** `true`_
#### buildName
Name of the build.
_**required:** `false`_
_**default:** `testBuild`_
#### buildsPath
Path where the builds should be stored.
In this folder a folder will be created for every targetPlatform.
_**required:** `false`_
_**default:** `build`_
#### buildCommand
Custom command to run your build.
There are two conditions for a custom buildCommand:
- Must reference a valid path to a `static` method.
- The class must reside in the `Assets/Editor` directory.
_**example:**_
```yaml
- uses: webbertakken/unity-builder@master
with:
buildCommand: EditorNamespace.BuilderClassName.StaticBulidMethod
```
_**required:** `false`_
_**default:** Built-in script that will run a build out of the box._
## More actions ## More actions