|
| 1 | +name: build |
| 2 | +permissions: |
| 3 | + contents: read |
| 4 | +on: |
| 5 | + workflow_call: |
| 6 | + inputs: |
| 7 | + matrix: |
| 8 | + required: true |
| 9 | + type: string |
| 10 | + secrets: |
| 11 | + UNITY_USERNAME: |
| 12 | + required: true |
| 13 | + UNITY_PASSWORD: |
| 14 | + required: true |
| 15 | +jobs: |
| 16 | + build: |
| 17 | + name: ${{ matrix.name }} |
| 18 | + strategy: |
| 19 | + matrix: ${{ fromJSON(inputs.matrix) }} |
| 20 | + fail-fast: false |
| 21 | + runs-on: ${{ matrix.os }} |
| 22 | + permissions: |
| 23 | + contents: read |
| 24 | + steps: |
| 25 | + - name: Free Disk Space |
| 26 | + if: ${{ matrix.os == 'ubuntu-latest' && matrix.unity-version == '6000.2' }} |
| 27 | + uses: endersonmenezes/free-disk-space@713d134e243b926eba4a5cce0cf608bfd1efb89a # v2.1.1 |
| 28 | + with: |
| 29 | + remove_android: true |
| 30 | + remove_dotnet: false |
| 31 | + - uses: actions/checkout@v5 |
| 32 | + - uses: RageAgainstThePixel/unity-setup@v2 |
| 33 | + with: |
| 34 | + version-file: None |
| 35 | + build-targets: ${{ matrix.build-target }} |
| 36 | + unity-version: ${{ matrix.unity-version }} |
| 37 | + - uses: RageAgainstThePixel/activate-unity-license@v2 |
| 38 | + with: |
| 39 | + license: Personal |
| 40 | + username: ${{ secrets.UNITY_USERNAME }} |
| 41 | + password: ${{ secrets.UNITY_PASSWORD }} |
| 42 | + - uses: ./ #RageAgainstThePixel/create-unity-project |
| 43 | + id: unity-project |
| 44 | + with: |
| 45 | + project-name: Test Project |
| 46 | + - name: Add Build Pipeline Package |
| 47 | + run: | |
| 48 | + npm install -g openupm-cli |
| 49 | + openupm add com.utilities.buildpipeline |
| 50 | + working-directory: ${{ steps.unity-project.outputs.project-path }} |
| 51 | + shell: bash |
| 52 | + - uses: RageAgainstThePixel/unity-action@v3 |
| 53 | + name: ${{ matrix.build-target }}-Validate |
| 54 | + with: |
| 55 | + build-target: ${{ matrix.build-target }} |
| 56 | + project-path: ${{ steps.unity-project.outputs.project-path }} |
| 57 | + log-name: ${{ matrix.build-target }}-Validate |
| 58 | + args: -quit -nographics -batchmode -executeMethod Utilities.Editor.BuildPipeline.UnityPlayerBuildTools.ValidateProject -importTMProEssentialsAsset |
| 59 | + - uses: RageAgainstThePixel/unity-action@v3 |
| 60 | + name: ${{ matrix.build-target }}-Build |
| 61 | + with: |
| 62 | + build-target: ${{ matrix.build-target }} |
| 63 | + project-path: ${{ steps.unity-project.outputs.project-path }} |
| 64 | + log-name: ${{ matrix.build-target }}-Build |
| 65 | + args: -quit -nographics -batchmode -executeMethod Utilities.Editor.BuildPipeline.UnityPlayerBuildTools.StartCommandLineBuild -sceneList Assets/Scenes/SampleScene.unity ${{ matrix.build-args }} |
| 66 | + - uses: actions/upload-artifact@v4 |
| 67 | + name: Upload Artifacts |
| 68 | + if: always() |
| 69 | + with: |
| 70 | + name: ${{ github.run_number }}.${{ github.run_attempt }} ${{ matrix.os }} ${{ matrix.unity-version }} ${{ matrix.build-target }} Artifacts |
| 71 | + path: | |
| 72 | + ${{ github.workspace }}/**/*.log |
| 73 | + ${{ github.workspace }}/**/Builds/${{ matrix.build-target }}/ |
0 commit comments