Build Unity projects for different platforms
Go to file
2019-12-22 22:43:47 +01:00
.github/workflows Update documentation 2019-12-22 22:43:47 +01:00
default-build-script Bring back meta file for builder 2019-12-08 00:48:22 +01:00
dist Remove console statements 2019-12-22 22:43:47 +01:00
src Remove console statements 2019-12-22 22:43:47 +01:00
test-project remove unnecessary tests 2019-12-22 22:43:47 +01:00
.dockerignore Cleanup 2019-12-22 22:43:47 +01:00
.editorconfig Add quality tools for javascript 2019-12-22 22:43:47 +01:00
.eslintignore Bootstrap docker from js 2019-12-22 22:43:47 +01:00
.eslintrc.json Run docker from javascript 2019-12-22 22:43:47 +01:00
.gitignore Package to dist folder using @zeit/ncc 2019-12-22 22:43:47 +01:00
.prettierignore Bootstrap docker from js 2019-12-22 22:43:47 +01:00
.prettierrc.json Add quality tools for javascript 2019-12-22 22:43:47 +01:00
.yarnrc Add quality tools for javascript 2019-12-22 22:43:47 +01:00
action.yml Cleanup 2019-12-22 22:43:47 +01:00
babel.config.js Run docker from javascript 2019-12-22 22:43:47 +01:00
Dockerfile Cleanup 2019-12-22 22:43:47 +01:00
entrypoint.sh Bootstrap docker from js 2019-12-22 22:43:47 +01:00
jest.config.js Run docker from javascript 2019-12-22 22:43:47 +01:00
LICENSE Add license (MIT) 2019-11-30 19:02:47 +01:00
package.json Run docker from javascript 2019-12-22 22:43:47 +01:00
README.md Update documentation 2019-12-22 22:43:47 +01:00
yarn.lock Run docker from javascript 2019-12-22 22:43:47 +01:00

Unity - Builder

Actions status


GitHub Action to build Unity projects for different platforms.

Part of the Unity Actions collection.


Github Action to build Unity projects for different platforms.

It is recommended to run the Test action from the Unity Actions collection before running this action. This action also requires the Activation step.

Documentation

See the Unity Actions collection repository for workflow documentation and reference implementation.

Usage

Create or edit the file called .github/workflows/main.yml and add a job to it.

name: Build project
on: [push]
jobs:
  buildForSomePlatforms:
    name: Build for ${{ matrix.targetPlatform }} on version ${{ matrix.unityVersion }}
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
      matrix:
        projectPath:
          - path/to/your/project
        unityVersion:
          - 2019.2.11f1
        targetPlatform:
          - WebGL
          - iOS
    steps:
      - uses: actions/checkout@v1
      - uses: webbertakken/unity-activate@v1
      - uses: webbertakken/unity-builder@v0.3
        with:
          projectPath: ${{ matrix.projectPath }}
          unityVersion: ${{ matrix.unityVersion }}
          targetPlatform: ${{ matrix.targetPlatform }}
      - uses: webbertakken/unity-return-license@v1
        if: always()
      - uses: actions/upload-artifact@v1
        with:
          name: Build
          path: build

Notes:

  • Don't forget to replace <test-project> with your project name.
  • By default the enabled scenes from the project's settings will be built.

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:

- 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

Visit Unity Actions to find related actions for Unity.

Feel free to contribute.

Licence

MIT