Create dummy secret.h in build workflow #7
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build Multi-Printer Firmware | |
| on: [push] | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| environment: [drucker_1, drucker_2, drucker_3] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 1 | |
| - name: Cache pip | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.cache/pip | |
| key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} | |
| - name: Cache PlatformIO | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.platformio | |
| key: ${{ runner.os }}-platformio | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.11' | |
| - name: Install PlatformIO | |
| run: pip install -U platformio | |
| - name: Create dummy secret.h if missing | |
| run: | | |
| mkdir -p firmware/octoprint/include | |
| touch firmware/octoprint/include/secret.h | |
| - name: Run PlatformIO Build | |
| run: pio run -e ${{ matrix.environment }} | |
| working-directory: firmware/octoprint | |
| env: | |
| WIFI_SSID: ${{ secrets.WIFI_SSID }} | |
| WIFI_PASS: ${{ secrets.WIFI_PASS }} | |
| API_KEY_D1: ${{ secrets.API_KEY_D1 }} | |
| API_KEY_D2: ${{ secrets.API_KEY_D2 }} | |
| API_KEY_D3: ${{ secrets.API_KEY_D3 }} | |
| - name: Upload Binary | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: firmware-${{ matrix.environment }} | |
| path: firmware/octoprint/.pio/build/${{ matrix.environment }}/firmware.bin |