Skip to content

Support multiple build support modules #721

@cryptiklemur

Description

@cryptiklemur

Context
In order to reduce complexity in CI/CD configs (less steps, less matrixes, less cache,
it would be nice if we could get game-ci/unity-builder to install modules for more than one targetPlatform.

Additional details

My use case: I'm working on a mod for RimWorld, that builds AssetBundles. The script i've created to do this can take a buildTarget as an argument. If one isn't passed, it will create do all three.

      - name: Build Windows AssetBundles
        if: steps.copyassets.outputs.hasAssets == 'true'
        uses: game-ci/unity-builder@v4
        continue-on-error: false
        timeout-minutes: 30
        env:
          UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
          UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
          UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
        with:
          unityVersion: 2022.3.35f1
          targetPlatform: StandaloneWindows64
          projectPath: AssetBuilder
          versioning: None
          allowDirtyBuild: true
          buildMethod: ModAssetBundleBuilder.BuildBundles
          customParameters: "-source=../RimworldCosmere/${{ matrix.mod }} -buildTarget=windows"
      - name: Build Mac AssetBundles
        if: steps.copyassets.outputs.hasAssets == 'true'
        uses: game-ci/unity-builder@v4
        continue-on-error: false
        timeout-minutes: 30
        env:
          UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
          UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
          UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
        with:
          unityVersion: 2022.3.35f1
          targetPlatform: StandaloneOSX
          projectPath: AssetBuilder
          versioning: None
          allowDirtyBuild: true
          buildMethod: ModAssetBundleBuilder.BuildBundles
          customParameters: "-source=../RimworldCosmere/${{ matrix.mod }} -buildTarget=mac"
      - name: Build Linux AssetBundles
        if: steps.copyassets.outputs.hasAssets == 'true'
        uses: game-ci/unity-builder@v4
        continue-on-error: false
        timeout-minutes: 30
        env:
          UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
          UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
          UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
        with:
          unityVersion: 2022.3.35f1
          targetPlatform: StandaloneLinux64
          projectPath: AssetBuilder
          versioning: None
          allowDirtyBuild: true
          buildMethod: ModAssetBundleBuilder.BuildBundles
          customParameters: "-source=../RimworldCosmere/${{ matrix.mod }} -buildTarget=linux"

I could clean this up into a single step, that doesn't have to deal with a matrix (which was my next plan) and artifact upload/download, or taking up a ton of disk space

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions