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.
This commit is contained in:
2025-11-30 23:39:43 -06:00
parent fe3a01c3c6
commit 50bc2cbfc8

View File

@@ -114,42 +114,50 @@ jobs:
uses: actions/checkout@50fbc622fc4ef5163becd7fab6573eac35f8462e # v1 uses: actions/checkout@50fbc622fc4ef5163becd7fab6573eac35f8462e # v1
- name: Install NodeJS - name: Install NodeJS
if: steps.should_build.outputs.should_run == 'true'
uses: actions/setup-node@f1f314fca9dfce2769ece7d933488f076716723e # v1 uses: actions/setup-node@f1f314fca9dfce2769ece7d933488f076716723e # v1
with: with:
node-version: ${{ matrix.node }} node-version: ${{ matrix.node }}
- name: Install Python - name: Install Python
if: steps.should_build.outputs.should_run == 'true'
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5 uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
with: with:
python-version: ${{ matrix.python }} python-version: ${{ matrix.python }}
- name: Install Poetry - name: Install Poetry
if: steps.should_build.outputs.should_run == 'true'
run: python -m pip install --upgrade pip poetry run: python -m pip install --upgrade pip poetry
- name: Sync versions - name: Sync versions
if: steps.should_build.outputs.should_run == 'true'
run: python scripts/sync_version.py run: python scripts/sync_version.py
- name: Install Python Deps - name: Install Python Deps
if: steps.should_build.outputs.should_run == 'true'
run: python -m poetry install run: python -m poetry install
- name: Install NodeJS Deps - name: Install NodeJS Deps
if: steps.should_build.outputs.should_run == 'true'
run: npm install run: npm install
- name: Prepare frontend directory - name: Prepare frontend directory
if: steps.should_build.outputs.should_run == 'true'
run: python scripts/prepare_frontend_dir.py run: python scripts/prepare_frontend_dir.py
- name: Download frontend artifact - name: Download frontend artifact
if: steps.should_build.outputs.should_run == 'true'
uses: actions/download-artifact@v4 uses: actions/download-artifact@v4
with: with:
name: frontend-build name: frontend-build
path: meshchatx/public path: meshchatx/public
- name: Install patchelf - 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 run: sudo apt-get update && sudo apt-get install -y patchelf
- name: Build Python wheel - name: Build Python wheel
if: matrix.name == 'linux' if: steps.should_build.outputs.should_run == 'true' && matrix.name == 'linux'
run: | run: |
python -m poetry build -f wheel python -m poetry build -f wheel
mkdir -p python-dist mkdir -p python-dist
@@ -157,9 +165,11 @@ jobs:
rm -rf dist rm -rf dist
- name: Build Electron App - name: Build Electron App
if: steps.should_build.outputs.should_run == 'true'
run: npm run dist-prebuilt run: npm run dist-prebuilt
- name: Create Release - name: Create Release
if: steps.should_build.outputs.should_run == 'true'
uses: ncipollo/release-action@b7eabc95ff50cbeeedec83973935c8f306dfcd0b # v1 uses: ncipollo/release-action@b7eabc95ff50cbeeedec83973935c8f306dfcd0b # v1
with: with:
draft: true draft: true