Added Surge #102
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: Bestagon-Defence build | |
on: | |
push: | |
pull_request: | |
types: | |
- opened | |
workflow_dispatch: | |
jobs: | |
buildForAllSupportedPlatforms: | |
name: Build for ${{ matrix.targetPlatform }} | |
runs-on: ${{ matrix.jobOS }} | |
strategy: | |
fail-fast: false | |
max-parallel: 5 | |
matrix: | |
include: | |
# Temporarily disabled as it wasn't working | |
#- targetPlatform: StandaloneOSX # Build a macOS standalone (Intel 64-bit). | |
# jobOS: macos-latest | |
- targetPlatform: StandaloneWindows # Build a Windows standalone. | |
jobOS: ubuntu-latest | |
- targetPlatform: StandaloneWindows64 # Build a Windows 64-bit standalone. | |
jobOS: ubuntu-latest | |
- targetPlatform: StandaloneLinux64 # Build a Linux 64-bit standalone. | |
jobOS: ubuntu-latest | |
# - targetPlatform: iOS # Build an iOS player. | |
# jobOS: ubuntu-latest | |
- targetPlatform: Android # Build an Android .apk standalone app. | |
jobOS: ubuntu-latest | |
# - targetPlatform: WebGL # WebGL. | |
# jobOS: ubuntu-latest | |
outputs: | |
StandaloneOSX: ${{ steps.outputResult.outputs.StandaloneOSX }} | |
StandaloneWindows: ${{ steps.outputResult.outputs.StandaloneWindows }} | |
StandaloneWindows64: ${{ steps.outputResult.outputs.StandaloneWindows64 }} | |
StandaloneLinux64: ${{ steps.outputResult.outputs.StandaloneLinux64 }} | |
#iOS: ${{ steps.outputResult.outputs.iOS }} | |
Android: ${{ steps.outputResult.outputs.Android }} | |
#WebGL: ${{ steps.outputResult.outputs.WebGL }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
lfs: true | |
- uses: actions/cache@v3 | |
with: | |
path: ${{ matrix.projectPath }}/Tower Defense/Library | |
key: | |
Library-${{ matrix.projectPath }}-${{ matrix.targetPlatform }}-${{ | |
hashFiles(matrix.projectPath) }} | |
restore-keys: | | |
Library-${{ matrix.projectPath }}-${{ matrix.targetPlatform }}- | |
Library-${{ matrix.projectPath }}- | |
Library- | |
Tower Defense-Library- | |
- uses: jlumbroso/free-disk-space@main | |
with: | |
# this might remove tools that are actually needed, | |
# if set to "true" but frees about 6 GB | |
tool-cache: false | |
# all of these default to true, but feel free to set to | |
# "false" if necessary for your workflow | |
android: true | |
dotnet: true | |
haskell: false | |
large-packages: true | |
docker-images: true | |
swap-storage: true | |
- uses: game-ci/unity-builder@v4 | |
env: | |
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }} | |
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }} | |
# Use for paid version: | |
# UNITY_SERIAL: ${{ secrets.UNITY_SERIAL }} | |
# Use for free version: | |
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }} | |
with: | |
projectPath: 'Tower Defence' | |
targetPlatform: ${{ matrix.targetPlatform }} | |
if: ${{ matrix.targetPlatform != 'Android' }} | |
- uses: game-ci/unity-builder@v4 | |
env: | |
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }} | |
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }} | |
# Use for paid version: | |
# UNITY_SERIAL: ${{ secrets.UNITY_SERIAL }} | |
# Use for free version: | |
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }} | |
with: | |
projectPath: 'Tower Defence' | |
targetPlatform: ${{ matrix.targetPlatform }} | |
androidKeystoreName: bestagon.keystore # This file won't exist, but this property needs to exist. | |
androidKeystoreBase64: ${{ secrets.ANDROID_KEYSTORE_BASE64 }} | |
androidKeystorePass: ${{ secrets.ANDROID_KEYSTORE_PASS }} | |
androidKeyaliasName: ${{ secrets.ANDROID_KEYALIAS_NAME }} | |
androidKeyaliasPass: ${{ secrets.ANDROID_KEYALIAS_PASS }} | |
androidTargetSdkVersion: AndroidApiLevel35 | |
if: ${{ matrix.targetPlatform == 'Android' }} | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: ${{ matrix.targetPlatform }} | |
path: | | |
build/ | |
!*DoNotShip/ | |
# Return License | |
# - uses: game-ci/unity-return-license@v2.0.0 | |
# if: always() | |
- id: outputResult | |
run: echo "${{ matrix.targetPlatform }}Result=${{ job.status }}" >> $GITHUB_ENV | |
sendSuccessNotification: | |
runs-on: ubuntu-latest | |
needs: | |
- buildForAllSupportedPlatforms | |
if: ${{ success() }} | |
steps: | |
- uses: tsickert/discord-webhook@v6.0.0 | |
with: | |
webhook-url: ${{ secrets.NIGHTLY_WEBHOOK_URL }} | |
content: "Build Success" | |
embed-title: "New Nightly Build Available!" | |
embed-description: "[You can get the new builds here](https://github.com/Greenfoot5/Bestagon-Defence/actions/runs/${{ github.run_id }}) | |
\n${{ env.StandaloneWindowsResult }}\n*You may need to scroll down to the bottom*" | |
embed-color: 1546855 | |
sendFailureNotification: | |
runs-on: ubuntu-latest | |
needs: | |
- buildForAllSupportedPlatforms | |
if: ${{ failure() }} | |
steps: | |
- uses: tsickert/discord-webhook@v6.0.0 | |
with: | |
webhook-url: ${{ secrets.NIGHTLY_WEBHOOK_URL }} | |
content: "Build Failure" | |
embed-title: "New Nightly Build Failed!" | |
embed-description: "[You can find the results here](https://github.com/Greenfoot5/Bestagon-Defence/actions/runs/${{ github.run_id }})\n${{ env.StandaloneWindowsResult }}" | |
embed-color: 10949957 | |