From 971c529d45a1ed5396e42b95f2dae23a716f2a30 Mon Sep 17 00:00:00 2001 From: Guo-Rong <5484552+gkoh@users.noreply.github.com> Date: Tue, 27 Feb 2024 13:33:01 +1030 Subject: [PATCH] Attempt to simplify release workflow with matrix strategy. --- .github/workflows/release.yml | 49 +++++++++++++++++++---------------- 1 file changed, 27 insertions(+), 22 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 028360b..139288e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -14,6 +14,15 @@ env: jobs: build: + + strategy: + matrix: + platform: + - m5stick-c + - m5stick-c-plus + - m5stack-core + - m5stack-core2 + runs-on: ubuntu-latest permissions: contents: write @@ -31,37 +40,33 @@ jobs: run: | pip install -r requirements.txt - - name: Build furble (M5StickC) - run: | - platformio run -e m5stick-c - cp -v .pio/build/m5stick-c/firmware.bin $M5STICKC_FIRMWARE - - - name: Build furble (M5StickC Plus) - run: | - platformio run -e m5stick-c-plus - cp -v .pio/build/m5stick-c-plus/firmware.bin $M5STICKC_PLUS_FIRMWARE + - name: Build furble (${{ matrix.platform }}) + run: platformio run -e ${{ matrix.platform }} - - name: Build furble (M5Stack Core) - run: | - platformio run -e m5stack-core - cp -v .pio/build/m5stack-core/firmware.bin $M5STACK_CORE_FIRMWARE + - name: Upload binary artifact (${{ matrix.platform }}) + uses: actions/upload-artifact@v4 + with: + name: furble-${{ matrix.platform }}-${{ github.ref_name }}+${{ github.run_attempt }}.bin + path: .pio/build/${{ matrix.platform }})/firmware.bin + if-no-files-found: error - - name: Build furble (M5Stack Core2) - run: | - platformio run -e m5stack-core2 - cp -v .pio/build/m5stack-core2/firmware.bin $M5STACK_CORE2_FIRMWARE + release: + needs: build + runs-on: ubuntu-latest + steps: + - name: Download binary artifacts + uses: actions/download-artifact@v4 + with: + merge-multiple: true - name: Generate release hashes run: | - sha256sum $M5STICKC_FIRMWARE $M5STICKC_PLUS_FIRMWARE $M%M5STACK_CORE_FIRMWARE $M5STACK_CORE2_FIRMWARE > sha256sum.txt + sha256sum furble-*.bin > sha256sum.txt - name: Release uses: softprops/action-gh-release@v1 with: generate_release_notes: true files: | - ${{ env.M5STICKC_FIRMWARE }} - ${{ env.M5STICKC_PLUS_FIRMWARE }} - ${{ env.M5STACK_CORE_FIRMWARE }} - ${{ env.M5STACK_CORE2_FIRMWARE }} + furble-*.bin sha256sum.txt