2024-09-27 18:01:17 -07:00
|
|
|
name: Build
|
2024-09-25 16:51:21 -07:00
|
|
|
|
2024-09-25 18:35:00 -07:00
|
|
|
on:
|
2024-09-27 18:01:17 -07:00
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- release
|
|
|
|
tags:
|
|
|
|
- 'v[0-9]+.[0-9]+.[0-9]+'
|
|
|
|
pull_request:
|
|
|
|
branches:
|
|
|
|
- release
|
2024-10-02 00:51:24 -07:00
|
|
|
schedule:
|
|
|
|
- cron: '0 2 * * *' # Run at 2 AM UTC every day
|
2024-09-25 16:51:21 -07:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
buildForAllSupportedPlatforms:
|
|
|
|
name: Build for ${{ matrix.targetPlatform }}
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
targetPlatform:
|
|
|
|
- StandaloneOSX # Build a macOS standalone (Intel 64-bit).
|
|
|
|
- StandaloneWindows64 # Build a Windows 64-bit standalone.
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v4
|
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
|
|
|
lfs: false
|
2024-09-25 19:40:32 -07:00
|
|
|
- uses: actions/cache@v4
|
2024-09-25 16:51:21 -07:00
|
|
|
with:
|
|
|
|
path: Library
|
|
|
|
key: Library-${{ matrix.targetPlatform }}
|
|
|
|
restore-keys: Library-
|
|
|
|
- if: matrix.targetPlatform == 'Android'
|
|
|
|
uses: jlumbroso/free-disk-space@v1.3.1
|
|
|
|
- uses: game-ci/unity-builder@v4
|
|
|
|
env:
|
|
|
|
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
|
|
|
|
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
|
|
|
|
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
|
|
|
|
with:
|
2024-09-27 18:01:17 -07:00
|
|
|
buildName: micromissiles-${{ github.ref_name }}-${{ matrix.targetPlatform }}
|
2024-09-25 18:35:00 -07:00
|
|
|
versioning: Semantic
|
2024-09-25 16:51:21 -07:00
|
|
|
targetPlatform: ${{ matrix.targetPlatform }}
|
2024-10-02 00:51:24 -07:00
|
|
|
- name: Copy Tools Directory
|
|
|
|
run: |
|
|
|
|
mkdir -p build/${{ matrix.targetPlatform }}/Tools
|
|
|
|
cp -r Tools/ build/${{ matrix.targetPlatform }}/Tools/
|
2024-09-27 18:01:17 -07:00
|
|
|
- if: matrix.targetPlatform == 'StandaloneWindows64'
|
|
|
|
run: cd build/${{ matrix.targetPlatform }} && sudo zip -r ../build-${{ matrix.targetPlatform }}.zip * && cd -
|
|
|
|
- if: matrix.targetPlatform == 'StandaloneWindows64'
|
|
|
|
uses: actions/upload-artifact@v4
|
2024-09-25 16:51:21 -07:00
|
|
|
with:
|
|
|
|
name: Build-${{ matrix.targetPlatform }}
|
2024-09-27 18:01:17 -07:00
|
|
|
path: build/build-${{ matrix.targetPlatform }}.zip
|
|
|
|
- if: matrix.targetPlatform == 'StandaloneOSX'
|
|
|
|
run: sudo tar -czvf build/build-${{ matrix.targetPlatform }}.tar.gz -C build/${{ matrix.targetPlatform }} .
|
|
|
|
- if: matrix.targetPlatform == 'StandaloneOSX'
|
|
|
|
uses: actions/upload-artifact@v4
|
|
|
|
with:
|
|
|
|
name: Build-${{ matrix.targetPlatform }}
|
|
|
|
path: build/build-${{ matrix.targetPlatform }}.tar.gz
|