diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9a14123..535531f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -69,16 +69,6 @@ jobs: name: Build Desktop (${{ matrix.name }}) needs: build_frontend runs-on: ${{ matrix.os }} - if: | - github.event_name == 'push' || - ( - github.event_name == 'workflow_dispatch' && - ( - (matrix.name == 'windows' && github.event.inputs.build_windows == 'true') || - (matrix.name == 'mac' && github.event.inputs.build_mac == 'true') || - (matrix.name == 'linux' && github.event.inputs.build_linux == 'true') - ) - ) strategy: fail-fast: false matrix: @@ -88,20 +78,39 @@ jobs: node: 22 python: "3.12" release_artifacts: "dist/*-win-installer.exe,dist/*-win-portable.exe" + build_input: build_windows - name: mac os: macos-13 node: 18 python: "3.11" release_artifacts: "dist/*-mac.dmg" + build_input: build_mac - name: linux os: ubuntu-latest node: 22 python: "3.12" release_artifacts: "dist/*-linux.AppImage,dist/*-linux.deb,python-dist/*.whl" + build_input: build_linux permissions: contents: write steps: + - name: Check if build should run + id: should_build + run: | + if [ "${{ github.event_name }}" = "push" ]; then + echo "should_run=true" >> $GITHUB_OUTPUT + elif [ "${{ github.event_name }}" = "workflow_dispatch" ]; then + if [ "${{ github.event.inputs[matrix.build_input] }}" = "true" ]; then + echo "should_run=true" >> $GITHUB_OUTPUT + else + echo "should_run=false" >> $GITHUB_OUTPUT + fi + else + echo "should_run=false" >> $GITHUB_OUTPUT + fi + - name: Clone Repo + if: steps.should_build.outputs.should_run == 'true' uses: actions/checkout@50fbc622fc4ef5163becd7fab6573eac35f8462e # v1 - name: Install NodeJS