name: Build and Release the OpenIris bin files on: push: branches: - "mdns-autodiscovery" - "master" pull_request: branches: - "master" workflow_dispatch: jobs: build: strategy: fail-fast: false matrix: target_name: [ esp32AITinker, esp32M5Stack, esp32CAM, esp_eye, wrover, ] target_build_type: [ "", _release, _OTA, ] runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - name: Cache pip uses: actions/cache@v3 with: path: ~/.cache/pip key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} restore-keys: ${{ runner.os }}-pip- - name: Cache PlatformIO uses: actions/cache@v3 with: path: ~/.platformio key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }} - name: Setup Python install uses: actions/setup-python@v4 with: python-version: '3.x' - name: Install PlatformIO with Pip run: | python -m pip install --upgrade pip pip install --upgrade platformio - name: Build OpenIris Firmware working-directory: ./ESP run: | pio run --environment ${{ matrix.target_name }}${{ matrix.target_build_type }} - name: Archive Version File uses: actions/upload-artifact@v3 with: name: version path: ./ESP/tools/version.txt - name: Archive Firmware name File # create an environment variable with the name of the firmware file by catting the firmware_name.txt file run: | echo "FIRMWARE_NAME=$(cat ./ESP/tools/firmware_name.txt)" >> $GITHUB_ENV - name: Archive Firmware Files uses: actions/upload-artifact@v3 with: name: ${{ matrix.target_name }}${{ matrix.target_build_type }}-firmware path: "./ESP/.pio/build/${{ matrix.target_name }}${{ matrix.target_build_type }}/${{ env.FIRMWARE_NAME }}.bin" if-no-files-found: error release-openiris: runs-on: ubuntu-latest needs: [build] steps: - name: Download Firmware Files uses: actions/download-artifact@v2 with: path: release - name: Release Firmware uses: ncipollo/release-action@v1 if: startsWith(github.ref, 'refs/tags/') with: artifacts: release/*/*.bin generateReleaseNotes: true allowUpdates: true token: ${{ secrets.GITHUB_TOKEN }}