Created
May 7, 2024 03:14
-
-
Save efarraro/f96ff6be5e2428674e7d61c33ebc280e to your computer and use it in GitHub Desktop.
Build.yml for Github Actions (Unity game)
This file contains hidden or 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 Bramble Royale | |
| # https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#workflow_dispatch | |
| on: [workflow_dispatch] | |
| jobs: | |
| build: | |
| name: Build Windows | |
| runs-on: ubuntu-latest | |
| outputs: | |
| buildVersion: ${{ steps.build.outputs.buildVersion }} | |
| steps: | |
| # Free disk space to resolve 'out of space' issue (https://github.com/marketplace/actions/free-disk-space-ubuntu) | |
| - name: Free Disk Space (Ubuntu) | |
| 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: true | |
| # Eric's note - this is confusing, but true=remove. Not "true = include this" | |
| android: true | |
| dotnet: true | |
| haskell: true | |
| large-packages: true | |
| docker-images: true | |
| swap-storage: true | |
| # Checkout | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| lfs: true | |
| # Cache | |
| - uses: actions/cache@v3 | |
| with: | |
| path: Library | |
| key: Library-${{ hashFiles('Assets/**', 'Packages/**', 'ProjectSettings/**') }} | |
| restore-keys: | | |
| Library- | |
| # Test | |
| #- name: Run tests | |
| # uses: game-ci/unity-test-runner@v4 | |
| # env: | |
| # UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }} | |
| # UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }} | |
| # UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }} | |
| # with: | |
| # githubToken: ${{ secrets.GITHUB_TOKEN }} | |
| # Build | |
| - name: Build project | |
| id: build | |
| uses: game-ci/unity-builder@v4 | |
| env: | |
| UNITY_SERIAL: ${{ secrets.UNITY_SERIAL }} | |
| UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }} | |
| UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }} | |
| with: | |
| targetPlatform: StandaloneWindows64 | |
| versioning: Semantic | |
| name: bramble-royale | |
| path: build/windows | |
| buildName: bramble-royale | |
| # Output | |
| - uses: actions/upload-artifact@v3 | |
| with: | |
| name: bramble-royale | |
| path: build | |
| deployToSteam: | |
| needs: [ build ] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Download StandaloneWindows64 Artifact | |
| uses: actions/download-artifact@v3 | |
| with: | |
| name: bramble-royale | |
| path: build | |
| - uses: game-ci/steam-deploy@v3 | |
| with: | |
| username: ${{ secrets.STEAM_USERNAME }} | |
| configVdf: ${{ secrets.STEAM_CONFIG_VDF}} | |
| appId: ${{ secrets.STEAM_APP_ID }} | |
| buildDescription: v${{ needs.build.outputs.buildVersion }} (Built by Github Action) | |
| rootPath: build | |
| depot1Path: StandaloneWindows64 | |
| releaseBranch: staging |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment