This GitHub Action allows you to automate the process of building a Unity project for the Windows 64-bit platform using a self-hosted runner. It facilitates the build process, ensuring that the necessary steps are executed smoothly.
unityPath
(required): The full path to the Unity executable.buildPath
(required): The path where the build artifacts will be stored.executeMethod
(required): The name of the Unity method to execute during the build.extraArgument
(required): Extra arguments to pass to the Unity build command.projectPath
(optional): The path to the Unity project. Default is the root of the repository.exeFileName
(required): The name of the .exe file to check for in the build folder.
This action runs using a composite run strategy, ensuring efficient execution of the defined steps.
- Check if Build Folder Exists: Verifies if the build folder already exists.
- Remove Existing Build Folder: Removes the existing build folder if it exists.
- Create Build Folder: Creates a new build folder.
- Unity Build: Executes the Unity build process based on the provided inputs.
- Check for Custom .exe File: Verifies if the custom .exe file exists in the build folder.
To use this action, follow the steps below:
- Configure your GitHub workflow to include this action.
- Provide the necessary inputs such as
unityPath
,buildPath
,executeMethod
,extraArgument
, andexeFileName
. - Run your workflow, and the action will handle the Unity build process for you.
name: Unity Build Workflow
on:
push:
branches:
- main
jobs:
build:
runs-on: self-hosted
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Unity Build
uses: cycleapple/unity-build-action@v1
with:
unityPath: '/path/to/unity/executable'
buildPath: './Build'
executeMethod: 'BuildPipeline.BuildPlayer'
extraArgument: '-developmentBuild'
projectPath: './UnityProject'
exeFileName: 'MyGame'
This action is licensed under the MIT License. Feel free to modify and use it according to your needs.