diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e6976aed..fbc42c81 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -63,8 +63,22 @@ jobs: runs-on: ${{ matrix.runner }} name: ${{ matrix.name }} + outputs: + job_build_type: ${{ steps.set-env.outputs.JOB_BUILD_TYPE }} + steps: + - name: Set JOB_BUILD_TYPE + id: set-env + run: | + if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then + echo "JOB_BUILD_TYPE=${{ github.event.inputs.build_type }}" >> $GITHUB_ENV + echo "::set-output name=JOB_BUILD_TYPE::${{ github.event.inputs.build_type }}" + else + echo "JOB_BUILD_TYPE=release" >> $GITHUB_ENV + echo "::set-output name=JOB_BUILD_TYPE::release" + fi + - name: Checkout project uses: actions/checkout@v4 with: @@ -102,17 +116,21 @@ jobs: cmake -B ${{ github.workspace }}/.out-${{ matrix.identifier }} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER=cl -DCMAKE_C_COMPILER=cl -S ${{ github.workspace }} -G Ninja - name: Build Orchestrator - if: ${{ github.event.inputs.build_type == 'both' }} || endsWith(matrix.identifier, github.event.inputs.build_type) + if: ${{ env.JOB_BUILD_TYPE == 'both' }} || endsWith(matrix.identifier, env.JOB_BUILD_TYPE) run: | cmake --build ${{ github.workspace }}/.out-${{ matrix.identifier }} --target orchestrator -j 18 - name: Prepare addon files - if: ${{ github.event.inputs.build_type == 'both' }} || endsWith(matrix.identifier, github.event.inputs.build_type) + if: ${{ env.JOB_BUILD_TYPE == 'both' }} || endsWith(matrix.identifier, env.JOB_BUILD_TYPE) + shell: bash run: | - cp '${{ github.workspace }}/AUTHORS.md' '${{ github.workspace }}/CHANGELOG.md' '${{ github.workspace }}/README.md' '${{ github.workspace }}/LICENSE' '${{ github.workspace }}/project/addons/orchestrator/' + cp '${{ github.workspace }}/AUTHORS.md' '${{ github.workspace }}/project/addons/orchestrator/' + cp '${{ github.workspace }}/CHANGELOG.md' '${{ github.workspace }}/project/addons/orchestrator/' + cp '${{ github.workspace }}/README.md' '${{ github.workspace }}/project/addons/orchestrator/' + cp '${{ github.workspace }}/LICENSE' '${{ github.workspace }}/project/addons/orchestrator/' - name: Upload artifact - if: ${{ github.event.inputs.build_type == 'both' }} || endsWith(matrix.identifier, github.event.inputs.build_type) + if: ${{ env.JOB_BUILD_TYPE == 'both' }} || endsWith(matrix.identifier, env.JOB_BUILD_TYPE) uses: actions/upload-artifact@v3 with: name: ${{ github.event.repository.name }}-$${ matrix.build_type }}