mirror of
https://github.com/game-ci/unity-builder.git
synced 2025-07-04 12:25:19 -04:00
Change workflow and variables to allow multiple build jobs
This commit is contained in:
parent
e9496f5ba2
commit
9a21280b09
91
.github/workflows/main.yml
vendored
91
.github/workflows/main.yml
vendored
@ -1,46 +1,65 @@
|
||||
name: Actions 😎
|
||||
|
||||
on:
|
||||
pull_request: {}
|
||||
push: { branches: [master] }
|
||||
|
||||
jobs:
|
||||
buildForWebGL:
|
||||
name: Build for WebGL 🕸
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
version: [v0.1, v0.2]
|
||||
|
||||
steps:
|
||||
# Checkout repository (required to test local actions)
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v1
|
||||
|
||||
# Activate license
|
||||
- name: Activate license
|
||||
uses: webbertakken/unity-activate@v1
|
||||
env:
|
||||
env:
|
||||
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
|
||||
PROJECT_PATH: test-project
|
||||
|
||||
# Configure builder
|
||||
- name: Build project
|
||||
id: buildStep
|
||||
uses: webbertakken/unity-builder@${{ matrix.version }}
|
||||
env:
|
||||
UNITY_PROJECT_PATH: test-project
|
||||
BUILD_NAME: TestBuild
|
||||
BUILD_TARGET: WebGL
|
||||
BUILDS_PATH: builds
|
||||
BUILD_METHOD: ""
|
||||
jobs:
|
||||
checkout:
|
||||
name: Checkout
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
|
||||
# Upload distributables
|
||||
- name: Upload Build
|
||||
uses: actions/upload-artifact@v1
|
||||
with:
|
||||
name: Build
|
||||
path: ${{ steps.buildStep.outputs.allBuildsPath }}
|
||||
activate:
|
||||
name: Activate Unity
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: webbertakken/unity-activate@v1
|
||||
|
||||
# Return license
|
||||
- name: Return License
|
||||
uses: webbertakken/unity-return-license@v1
|
||||
test:
|
||||
name: Test the project
|
||||
needs: [checkout, activate]
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: webbertakken/unity-test-runner@v1
|
||||
|
||||
buildForWebGL:
|
||||
name: Build for WebGL
|
||||
needs: [test]
|
||||
runs-on: ubuntu-latest
|
||||
steps: # webbertakken/unity-builder@v0.3-webgl
|
||||
- uses: ./
|
||||
|
||||
|
||||
buildForAndroid:
|
||||
name: Build for Android
|
||||
needs: [test]
|
||||
runs-on: ubuntu-latest
|
||||
steps: # webbertakken/unity-builder@v0.3-android
|
||||
- uses: ./
|
||||
|
||||
uploadBuildArtifacts:
|
||||
name: Upload Build Artifacts
|
||||
needs:
|
||||
- buildForWebGL
|
||||
- buildForAndroid
|
||||
if: always()
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/upload-artifact@v1
|
||||
with:
|
||||
name: Builds
|
||||
path: builds
|
||||
|
||||
returnTheLicense:
|
||||
name: Return the license
|
||||
needs: [uploadBuildArtifacts]
|
||||
if: always()
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: webbertakken/unity-return-license@v1
|
||||
|
@ -9,6 +9,8 @@ LABEL "repository"="http://github.com/webbertakken/unity-actions"
|
||||
LABEL "homepage"="http://github.com/webbertakken/unity-actions"
|
||||
LABEL "maintainer"="Webber Takken <webber@takken.io>"
|
||||
|
||||
ENV BUILD_TARGET=WebGL
|
||||
|
||||
ADD default-build-script /UnityBuilderAction
|
||||
ADD entrypoint.sh /entrypoint.sh
|
||||
RUN chmod +x /entrypoint.sh
|
||||
|
@ -5,8 +5,6 @@ inputs: {}
|
||||
outputs:
|
||||
buildPath:
|
||||
description: "Path where the current platform has been built to."
|
||||
allBuildsPath:
|
||||
description: "Path where the build folders are stored. Each platform creates a folder within it."
|
||||
runs:
|
||||
using: 'docker'
|
||||
image: 'Dockerfile'
|
||||
|
@ -1,17 +1,16 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
#
|
||||
# Set project path
|
||||
# Set project path (configured with "with: { project: somepath }"
|
||||
#
|
||||
|
||||
UNITY_PROJECT_PATH=$GITHUB_WORKSPACE/$UNITY_PROJECT_PATH
|
||||
UNITY_PROJECT_PATH=$GITHUB_WORKSPACE/$PROJECT_PATH
|
||||
|
||||
#
|
||||
# Set the name for the build
|
||||
#
|
||||
|
||||
if [ -z "$BUILD_NAME" ]; then
|
||||
BUILD_NAME=buildName
|
||||
BUILD_NAME="build-$(date '+%F-%H%M')"
|
||||
fi
|
||||
|
||||
#
|
||||
|
Loading…
Reference in New Issue
Block a user