fix naming #7
Workflow file for this run
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 OctoPrint Firmware | |
| on: | |
| push: | |
| paths: | |
| - 'firmware/octoprint/**' | |
| branches: | |
| - main | |
| tags: | |
| - 'v*' | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| # Achte darauf, dass diese Namen exakt mit der platformio.ini übereinstimmen | |
| environment: [octo_drucker_1, octo_drucker_2, octo_drucker_3] | |
| steps: | |
| - name: Checkout Code | |
| uses: actions/checkout@v4 | |
| - 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 | |
| working-directory: firmware/octoprint | |
| run: pio run -e ${{ matrix.environment }} | |
| env: | |
| WIFI_SSID: ${{ secrets.WIFI_SSID }} | |
| WIFI_PASS: ${{ secrets.WIFI_PASS }} | |
| # Mappings der GitHub Secrets auf die PlatformIO System-Variablen | |
| OCTO_API_KEY_D1: ${{ secrets.OCTO_API_KEY_D1 }} | |
| OCTO_API_KEY_D2: ${{ secrets.OCTO_API_KEY_D2 }} | |
| OCTO_API_KEY_D3: ${{ secrets.OCTO_API_KEY_D3 }} | |
| - name: Upload Artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: firmware-${{ matrix.environment }} | |
| path: firmware/octoprint/.pio/build/${{ matrix.environment }}/firmware.bin | |
| release: | |
| needs: build | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Download all artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: ./artifacts | |
| - name: Prepare Release Assets | |
| run: | | |
| mv ./artifacts/firmware-octo_drucker_1/firmware.bin ./octo_drucker_1.bin | |
| mv ./artifacts/firmware-octo_drucker_2/firmware.bin ./octo_drucker_2.bin | |
| mv ./artifacts/firmware-octo_drucker_3/firmware.bin ./octo_drucker_3.bin | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| files: | | |
| ./octo_drucker_1.bin | |
| ./octo_drucker_2.bin | |
| ./octo_drucker_3.bin | |
| body: "Automatischer Build der OctoPrint-Varianten für Version ${{ github.ref_name }}" | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |