Update README.md #7
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Actions 😎 | |
# only run when pushed to master or main branches | |
on: | |
push: | |
branches: | |
- master | |
- main | |
jobs: | |
build: | |
name: Build for ${{ matrix.targetPlatform }} | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
targetPlatform: # uncomment some of the following lines to build for specific platform | |
# - StandaloneOSX # Build a macOS standalone (Intel 64-bit). | |
# - 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. | |
steps: | |
# Checkout | |
- name: Checkout repository 🛒 | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
lfs: 'true' | |
# Cache | |
- name: Cache 💾 | |
uses: actions/cache@v3 | |
with: | |
path: Library | |
key: Library-${{ matrix.targetPlatform }} | |
restore-keys: Library- | |
- if: matrix.targetPlatform == 'Android' | |
uses: jlumbroso/[email protected] | |
# Build | |
- name: Build project 🔨 | |
uses: game-ci/unity-builder@v4 | |
env: | |
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }} | |
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }} | |
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }} | |
with: | |
versioning: Semantic | |
targetPlatform: ${{ matrix.targetPlatform }} | |
# customImage: 'unityci/editor:2020.1.14f1-base-0' | |
# Deploy | |
- name: Deploy 🚀 | |
if: matrix.targetPlatform == 'WebGL' # Deploy webgl build only for WebGL | |
uses: JamesIves/github-pages-deploy-action@v4 | |
with: | |
folder: build/WebGL/WebGL # The folder the action should deploy. | |
single-commit: true | |
# Archive artifacts | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: Build-${{ matrix.targetPlatform }} | |
path: build/${{ matrix.targetPlatform }} | |