From 17d2b74389dc44237ab24ce4f54361dff16a4e2f Mon Sep 17 00:00:00 2001 From: Ben Allfree Date: Sat, 22 Nov 2025 09:05:35 -0800 Subject: [PATCH] build workflow --- .github/workflows/custom_build.yml | 64 ++++++++++++++++++++++++++++++ convex/actions.ts | 2 +- 2 files changed, 65 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/custom_build.yml diff --git a/.github/workflows/custom_build.yml b/.github/workflows/custom_build.yml new file mode 100644 index 0000000..d9ab712 --- /dev/null +++ b/.github/workflows/custom_build.yml @@ -0,0 +1,64 @@ +name: Custom Firmware Build + +on: + workflow_dispatch: + inputs: + target: + description: 'Target board (e.g. rak4631)' + required: true + type: string + flags: + description: 'Build flags (e.g. -DMESHTASTIC_EXCLUDE_MQTT)' + required: false + type: string + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout Web Flasher (this repo) + uses: actions/checkout@v4 + + - name: Checkout Firmware + uses: actions/checkout@v4 + with: + repository: meshtastic/firmware + ref: develop + path: firmware + submodules: recursive + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.x' + + - name: Install PlatformIO + run: | + python -m pip install --upgrade pip + pip install platformio + + - name: Build Firmware + working-directory: firmware + run: | + echo "Building for target: ${{ inputs.target }}" + echo "Flags: ${{ inputs.flags }}" + + # Inject flags into platformio.ini or environment if needed + # For now, we rely on PIO's ability to take env vars or just run the target + # Real implementation might need more complex flag handling + + # Example: export PLATFORMIO_BUILD_FLAGS="${{ inputs.flags }}" + + pio run -e ${{ inputs.target }} + + - name: Upload Artifact + uses: actions/upload-artifact@v4 + with: + name: firmware-${{ inputs.target }} + path: firmware/.pio/build/${{ inputs.target }}/firmware.bin + + - name: Notify Convex + if: always() + run: | + # TODO: Send webhook to Convex with status + echo "Build finished with status: ${{ job.status }}" diff --git a/convex/actions.ts b/convex/actions.ts index 29ac7b1..3057275 100644 --- a/convex/actions.ts +++ b/convex/actions.ts @@ -13,7 +13,7 @@ export const dispatchGithubBuild = action({ } const response = await fetch( - "https://api.github.com/repos/meshtastic/firmware/actions/workflows/custom_build.yml/dispatches", + "https://api.github.com/repos/MeshEnvy/configurable-web-flasher/actions/workflows/custom_build.yml/dispatches", { method: "POST", headers: {