Skip to content

A github action which may be used for unity builds and tests

License

MIT, Unknown licenses found

Licenses found

MIT
LICENSE
Unknown
license.sh
Notifications You must be signed in to change notification settings

ncipollo/unity-action

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

63 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Unity Action

This action may be used to generate a Unity build or run tests within a Unity project.

Action Inputs

  • build_method: The static method to execute during the build.
  • license: Your unity license. Use secrets!
  • mode: The mode to run the action in. Can be set to build or test.
  • password: Your unity password. Required to generate license. Use secrets!
  • serial: Your unity pro serial number. Required to generate pro license. Not required for unity personal. Use secrets!
  • username: Your unity user name. Required to generate license. Use secrets!

License

To generate a license:

  • Omit the license input
  • Include your username, password and serial (optionally for pro licenses).
  • Look for the xml dump in the output.
  • Copy this xml dump into an .alf file.
  • Follow the steps found here: ManualActivationGuide.
  • Copy the contents of the .ulf into a secret then use this with the license input.

Tests

This action can be utilized for running your unity tests. Set mode to test (or omit this input). The action will then run the tests found within the project.

Example:

name: Unity Test

on: [push]

jobs:

  build:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v1
    - name: 'run unity tests'
      uses: ncipollo/unity-action@master
      with: 
        username: ${{ secrets.username }}
        password: ${{ secrets.password }}
        license: ${{ secrets.license }}

Builds

This action may also be utilized to run your build pipeline. Set mode to build. You must also specify a static class method to run using build_method. This would typically be a method on a build class. For example: BuildCommand.cs

Example:

name: Unity Build

on: [push]

jobs:

  build:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v1
    - name: 'run unity build'
      uses: ncipollo/unity-action@master
      with: 
        license: ${{ secrets.license }}
        mode: build
        build_method: BuildCommand.PerformBuild
    - name: 'upload artifact'
      uses: actions/upload-artifact@v1.0.0
      with:
        name: build.tar.gz
        path: Build/os_x

Attribution

This action heavily relies on https://gitlab.com/gableroux/unity3d. They have a Patreon account listed so if you find this useful consider becoming a patron there 🙂.

About

A github action which may be used for unity builds and tests

Resources

License

MIT, Unknown licenses found

Licenses found

MIT
LICENSE
Unknown
license.sh

Stars

Watchers

Forks

Packages

No packages published