Upgrade docs, reduce RAM usage, and fix minor bugs (plugin power_sour… #75
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 Firmware | |
| on: | |
| push: | |
| branches: [main, master, release, develop, feature/*] | |
| tags: ['v*'] | |
| pull_request: | |
| branches: [main, master, release] | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Setup Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.11' | |
| - name: Install PlatformIO | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install platformio | |
| - name: Build firmware | |
| run: pio run | |
| - name: Build initial plugins FAT image (with lang overlay) | |
| run: | | |
| pip install construct | |
| python tools/build_lang_image.py \ | |
| --lang-dir assets/i18n \ | |
| --output build/plugins_initial.bin | |
| - name: Get version info | |
| id: version | |
| env: | |
| GIT_REF: ${{ github.ref }} | |
| run: | | |
| if [[ "$GIT_REF" == refs/tags/* ]]; then | |
| VERSION=${GIT_REF#refs/tags/} | |
| else | |
| VERSION=$(git rev-parse --short HEAD) | |
| fi | |
| echo "version=$VERSION" >> $GITHUB_OUTPUT | |
| echo "Building version: $VERSION" | |
| - name: Rename firmware artifacts | |
| env: | |
| VERSION: ${{ steps.version.outputs.version }} | |
| run: | | |
| mkdir -p artifacts | |
| cp .pio/build/cdc_badge_usb/firmware.bin "artifacts/cdc-badge-firmware-${VERSION}.bin" | |
| cp .pio/build/cdc_badge_usb/bootloader.bin "artifacts/cdc-badge-bootloader-${VERSION}.bin" | |
| cp .pio/build/cdc_badge_usb/partitions.bin "artifacts/cdc-badge-partitions-${VERSION}.bin" | |
| cp build/plugins_initial.bin "artifacts/cdc-badge-plugins-initial-${VERSION}.bin" | |
| - name: Upload firmware artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: cdc-badge-firmware-${{ steps.version.outputs.version }} | |
| path: artifacts/ | |
| retention-days: 90 | |
| release: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| steps: | |
| - name: Get version | |
| id: version | |
| env: | |
| GIT_REF: ${{ github.ref }} | |
| run: echo "version=${GIT_REF#refs/tags/}" >> $GITHUB_OUTPUT | |
| - name: Download artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: cdc-badge-firmware-${{ steps.version.outputs.version }} | |
| path: artifacts/ | |
| - name: Create Release | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| files: artifacts/* | |
| generate_release_notes: true | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |