Skip to content

Commit

Permalink
Attempt to simplify release workflow with matrix strategy.
Browse files Browse the repository at this point in the history
  • Loading branch information
gkoh committed Feb 27, 2024
1 parent 34b69fe commit 971c529
Showing 1 changed file with 27 additions and 22 deletions.
49 changes: 27 additions & 22 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

0 comments on commit 971c529

Please sign in to comment.