[Fix] Gotta love it when Unity doesn't save changed values during run… #49
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: Build CYF & Notify | |
on: [push, pull_request, workflow_dispatch] | |
jobs: | |
buildWindows: | |
name: Build CYF (Windows) | |
runs-on: ubuntu-latest | |
steps: | |
# Checkout | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
with: | |
lfs: true | |
# Cache | |
- uses: actions/cache@v2 | |
with: | |
path: Library | |
key: Library-${{ hashFiles('Assets/**', 'Packages/**', 'ProjectSettings/**') }} | |
restore-keys: | | |
Library- | |
# Build | |
- name: Build project | |
uses: game-ci/unity-builder@v2 | |
env: | |
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }} | |
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }} | |
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }} | |
with: | |
targetPlatform: StandaloneWindows64 | |
buildMethod: UnityBuilderAction.BuildScript.Build | |
buildName: CreateYourFrisk-win64 | |
# Copy Assets to Build | |
- run: sudo mkdir -v "${{ github.workspace }}/build/StandaloneWindows64/Default" "${{ github.workspace }}/build/StandaloneWindows64/Mods" | |
- run: sudo cp -Rv "${{ github.workspace }}/Assets/Default/" "${{ github.workspace }}/build/StandaloneWindows64/" | |
- run: sudo cp -Rv "${{ github.workspace }}/Assets/Mods/" "${{ github.workspace }}/build/StandaloneWindows64/" | |
- run: sudo cp -Rv "${{ github.workspace }}/Documentation CYF 1.0/" "${{ github.workspace }}/build" | |
- run: sudo find ${{ github.workspace }}/build/StandaloneWindows64/ -name "*.meta" -type f -delete | |
- run: sudo mv ${{ github.workspace }}/build/StandaloneWindows64/ ${{ github.workspace }}/build/CreateYourFrisk/ | |
# Output | |
- uses: actions/upload-artifact@v2 | |
with: | |
name: CreateYourFrisk-win64 | |
path: build | |
buildMacOS: | |
name: Build CYF (MacOS) | |
runs-on: ubuntu-latest | |
steps: | |
# Checkout | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
with: | |
lfs: true | |
# Cache | |
- uses: actions/cache@v2 | |
with: | |
path: Library | |
key: Library-${{ hashFiles('Assets/**', 'Packages/**', 'ProjectSettings/**') }} | |
restore-keys: | | |
Library- | |
# Build | |
- name: Build project | |
uses: game-ci/unity-builder@v2 | |
env: | |
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }} | |
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }} | |
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }} | |
with: | |
targetPlatform: StandaloneOSX | |
buildMethod: UnityBuilderAction.BuildScript.Build | |
buildName: CreateYourFrisk-macos64 | |
# Copy Assets to Build | |
- run: sudo mkdir -v "${{ github.workspace }}/build/StandaloneOSX/Default" "${{ github.workspace }}/build/StandaloneOSX/Mods" | |
- run: sudo cp -Rv "${{ github.workspace }}/Assets/Default/" "${{ github.workspace }}/build/StandaloneOSX/" | |
- run: sudo cp -Rv "${{ github.workspace }}/Assets/Mods/" "${{ github.workspace }}/build/StandaloneOSX/" | |
- run: sudo cp -Rv "${{ github.workspace }}/Documentation CYF 1.0/" "${{ github.workspace }}/build" | |
- run: sudo cp "${{ github.workspace }}/How to use CYF and add mods (Mac).txt" "${{ github.workspace }}/build/StandaloneOSX/" | |
- run: sudo find ${{ github.workspace }}/build/StandaloneOSX/ -name "*.meta" -type f -delete | |
- run: sudo mv ${{ github.workspace }}/build/StandaloneOSX/ ${{ github.workspace }}/build/CreateYourFrisk/ | |
# Output | |
- uses: actions/upload-artifact@v2 | |
with: | |
name: CreateYourFrisk-macos64 | |
path: build | |
buildLinux: | |
name: Build CYF (Linux) | |
runs-on: ubuntu-latest | |
steps: | |
# Checkout | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
with: | |
lfs: true | |
# Cache | |
- uses: actions/cache@v2 | |
with: | |
path: Library | |
key: Library-${{ hashFiles('Assets/**', 'Packages/**', 'ProjectSettings/**') }} | |
restore-keys: | | |
Library- | |
# Build | |
- name: Build project | |
uses: game-ci/unity-builder@v2 | |
env: | |
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }} | |
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }} | |
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }} | |
with: | |
targetPlatform: StandaloneLinux64 | |
buildMethod: UnityBuilderAction.BuildScript.Build | |
buildName: CreateYourFrisk-lin64 | |
# Copy Assets to Build | |
- run: sudo mkdir -v "${{ github.workspace }}/build/StandaloneLinux64/Default" "${{ github.workspace }}/build/StandaloneLinux64/Mods" | |
- run: sudo cp -Rv "${{ github.workspace }}/Assets/Default/" "${{ github.workspace }}/build/StandaloneLinux64/" | |
- run: sudo cp -Rv "${{ github.workspace }}/Assets/Mods/" "${{ github.workspace }}/build/StandaloneLinux64/" | |
- run: sudo cp -Rv "${{ github.workspace }}/Documentation CYF 1.0/" "${{ github.workspace }}/build" | |
- run: sudo find ${{ github.workspace }}/build/StandaloneLinux64/ -name "*.meta" -type f -delete | |
- run: sudo mv ${{ github.workspace }}/build/StandaloneLinux64/ ${{ github.workspace }}/build/CreateYourFrisk/ | |
# Output | |
- uses: actions/upload-artifact@v2 | |
with: | |
name: CreateYourFrisk-lin64 | |
path: build | |
message-success: | |
runs-on: ubuntu-latest | |
needs: [buildWindows, buildMacOS, buildLinux] | |
if: success() | |
steps: | |
- name: Send Success Message | |
uses: tsickert/discord-webhook@v5.3.0 | |
with: | |
webhook-url: ${{ secrets.NIGHTLY_WEBHOOK_LINK }} | |
username: Poseur Mail Service | |
avatar-url: https://github.githubassets.com/assets/GitHub-Mark-ea2971cee799.png | |
content: | | |
The last CYF nightly is ready to be used! Enjoy! | |
The links are stored here: https://discord.com/channels/110129114882543616/220238710271115265/1129795830317064314 | |
message-failure: | |
runs-on: ubuntu-latest | |
needs: [buildWindows, buildMacOS, buildLinux] | |
if: failure() | |
steps: | |
- name: Send Failure Message | |
uses: tsickert/discord-webhook@v5.3.0 | |
with: | |
webhook-url: ${{ secrets.NIGHTLY_WEBHOOK_LINK }} | |
username: Poseur Mail Service | |
avatar-url: https://github.githubassets.com/assets/GitHub-Mark-ea2971cee799.png | |
content: | | |
Oh no! The last CYF build failed! You're bad at your job! | |
The run's details are here: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} |