From 50bc2cbfc8282b480d2eb2c9b11a71e7f15181ab Mon Sep 17 00:00:00 2001 From: Ivan Date: Sun, 30 Nov 2025 23:39:43 -0600 Subject: [PATCH] Enhance GitHub Actions workflow with conditional execution - Added conditional checks to ensure build steps only run when necessary. - Streamlined the installation and build processes for NodeJS and Python based on the new build input logic. - Improved clarity and efficiency in the workflow by consolidating conditions for Linux-specific tasks. --- .github/workflows/build.yml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 535531f..8e5cef2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -114,42 +114,50 @@ jobs: uses: actions/checkout@50fbc622fc4ef5163becd7fab6573eac35f8462e # v1 - name: Install NodeJS + if: steps.should_build.outputs.should_run == 'true' uses: actions/setup-node@f1f314fca9dfce2769ece7d933488f076716723e # v1 with: node-version: ${{ matrix.node }} - name: Install Python + if: steps.should_build.outputs.should_run == 'true' uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5 with: python-version: ${{ matrix.python }} - name: Install Poetry + if: steps.should_build.outputs.should_run == 'true' run: python -m pip install --upgrade pip poetry - name: Sync versions + if: steps.should_build.outputs.should_run == 'true' run: python scripts/sync_version.py - name: Install Python Deps + if: steps.should_build.outputs.should_run == 'true' run: python -m poetry install - name: Install NodeJS Deps + if: steps.should_build.outputs.should_run == 'true' run: npm install - name: Prepare frontend directory + if: steps.should_build.outputs.should_run == 'true' run: python scripts/prepare_frontend_dir.py - name: Download frontend artifact + if: steps.should_build.outputs.should_run == 'true' uses: actions/download-artifact@v4 with: name: frontend-build path: meshchatx/public - name: Install patchelf - if: matrix.name == 'linux' + if: steps.should_build.outputs.should_run == 'true' && matrix.name == 'linux' run: sudo apt-get update && sudo apt-get install -y patchelf - name: Build Python wheel - if: matrix.name == 'linux' + if: steps.should_build.outputs.should_run == 'true' && matrix.name == 'linux' run: | python -m poetry build -f wheel mkdir -p python-dist @@ -157,9 +165,11 @@ jobs: rm -rf dist - name: Build Electron App + if: steps.should_build.outputs.should_run == 'true' run: npm run dist-prebuilt - name: Create Release + if: steps.should_build.outputs.should_run == 'true' uses: ncipollo/release-action@b7eabc95ff50cbeeedec83973935c8f306dfcd0b # v1 with: draft: true