Forward UNITY_LICENSE var and add all platforms

This commit is contained in:
Webber 2020-01-07 23:46:19 +01:00 committed by Webber Takken
parent 6297618cb1
commit a76c6a7321
4 changed files with 48 additions and 25 deletions

View File

@ -20,23 +20,18 @@ jobs:
- 2019.2.11f1 - 2019.2.11f1
- 2019.3.0f1 - 2019.3.0f1
targetPlatform: targetPlatform:
- WebGL - StandaloneOSX # Build a macOS standalone (Intel 64-bit).
- iOS - StandaloneWindows # Build a Windows standalone.
# - StandaloneOSX - StandaloneWindows64 # Build a Windows 64-bit standalone.
# - StandaloneWindows - StandaloneLinux64 # Build a Linux 64-bit standalone.
# - StandaloneWindows64 - iOS # Build an iOS player.
# - StandaloneLinux64 - Android # Build an Android .apk standalone app.
# - PS4 - WebGL # WebGL.
# - XboxOne - WSAPlayer # Build an Windows Store Apps player.
# - Switch - PS4 # Build a PS4 Standalone.
# - Android - XboxOne # Build a Xbox One Standalone.
# - tvOS - tvOS # Build to Apple's tvOS platform.
# - Lumin - Switch # Build a Nintendo Switch player.
# - BJM
# - Stadia
# - WSAPlayer
# - Facebook
# - NoTarget
steps: steps:
- uses: actions/checkout@v1 - uses: actions/checkout@v1

View File

@ -33,9 +33,28 @@ collection repository for workflow documentation and reference implementation.
Create or edit the file called `.github/workflows/main.yml` and add a job to it. Create or edit the file called `.github/workflows/main.yml` and add a job to it.
```yaml
- uses: webbertakken/unity-builder@v0.5
env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
with:
projectPath: path/to/your/project
unityVersion: 2020.X.XXXX
targetPlatform: WebGL
```
A complete workflow that builds every available platform could look like this:
```yaml ```yaml
name: Build project name: Build project
on: [push]
on:
pull_request: {}
push: { branches: [master] }
env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
jobs: jobs:
buildForSomePlatforms: buildForSomePlatforms:
name: Build for ${{ matrix.targetPlatform }} on version ${{ matrix.unityVersion }} name: Build for ${{ matrix.targetPlatform }} on version ${{ matrix.unityVersion }}
@ -47,19 +66,27 @@ jobs:
- path/to/your/project - path/to/your/project
unityVersion: unityVersion:
- 2019.2.11f1 - 2019.2.11f1
- 2019.3.0f1
targetPlatform: targetPlatform:
- WebGL - StandaloneOSX # Build a macOS standalone (Intel 64-bit).
- iOS - StandaloneWindows # Build a Windows standalone.
- StandaloneWindows64 # Build a Windows 64-bit standalone.
- StandaloneLinux64 # Build a Linux 64-bit standalone.
- iOS # Build an iOS player.
- Android # Build an Android .apk standalone app.
- WebGL # WebGL.
- WSAPlayer # Build an Windows Store Apps player.
- PS4 # Build a PS4 Standalone.
- XboxOne # Build a Xbox One Standalone.
- tvOS # Build to Apple's tvOS platform.
- Switch # Build a Nintendo Switch player.
steps: steps:
- uses: actions/checkout@v1 - uses: actions/checkout@v1
- uses: webbertakken/unity-activate@v1 - uses: webbertakken/unity-builder@v0.5
- uses: webbertakken/unity-builder@v0.3
with: with:
projectPath: ${{ matrix.projectPath }} projectPath: ${{ matrix.projectPath }}
unityVersion: ${{ matrix.unityVersion }} unityVersion: ${{ matrix.unityVersion }}
targetPlatform: ${{ matrix.targetPlatform }} targetPlatform: ${{ matrix.targetPlatform }}
- uses: webbertakken/unity-return-license@v1
if: always()
- uses: actions/upload-artifact@v1 - uses: actions/upload-artifact@v1
with: with:
name: Build name: Build

File diff suppressed because one or more lines are too long

View File

@ -23,6 +23,7 @@ export default class Docker {
const command = `docker run \ const command = `docker run \
--workdir /github/workspace \ --workdir /github/workspace \
--rm \ --rm \
--env UNITY_LICENSE \
--env PROJECT_PATH=${projectPath} \ --env PROJECT_PATH=${projectPath} \
--env BUILD_TARGET=${platform} \ --env BUILD_TARGET=${platform} \
--env BUILD_NAME=${buildName} \ --env BUILD_NAME=${buildName} \