Skip to content

Commit

Permalink
Update workflow actions and M5Unified dependency. (#61)
Browse files Browse the repository at this point in the history
* Update M5Unified dependency
* Use matrix strategy for releases
  • Loading branch information
gkoh authored Feb 27, 2024
1 parent 6bf9fea commit 2eeac47
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 34 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Run clang-format style check
uses: jidicula/[email protected]
Expand All @@ -39,10 +39,10 @@ jobs:
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.10'
cache: 'pip'
Expand Down
65 changes: 35 additions & 30 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,29 @@ on:
tags:
- 'v*'

env:
FURBLE_VERSION: ${{ github.ref_name }}+${{ github.run_attempt }}
M5STICKC_FIRMWARE: furble-m5stick-c-${{ github.ref_name }}+${{ github.run_attempt }}.bin
M5STICKC_PLUS_FIRMWARE: furble-m5stick-c-plus-${{ github.ref_name }}+${{ github.run_attempt }}.bin
M5STACK_CORE_FIRMWARE: furble-m5stack-core-${{ github.ref_name }}+${{ github.run_attempt }}.bin
M5STACK_CORE2_FIRMWARE: furble-m5stack-core2-${{ github.ref_name }}+${{ github.run_attempt }}.bin

jobs:
build:

strategy:
matrix:
platform:
- m5stick-c
- m5stick-c-plus
- m5stack-core
- m5stack-core2

runs-on: ubuntu-latest
permissions:
contents: write

env:
FIRMWARE_NAME: furble-${{ matrix.platform }}-${{ github.ref_name }}+${{ github.run_attempt }}.bin

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.10'
cache: 'pip'
Expand All @@ -31,37 +36,37 @@ 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 (${{ matrix.platform }})
run: platformio run -e ${{ matrix.platform }}

- 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: Rename binary (${{ matrix.platform}})
run: mv .pio/build/${{ matrix.platform }}/firmware.bin $FIRMWARE_NAME

- 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: ${{ env.FIRMWARE_NAME }}
path: ${{ env.FIRMWARE_NAME }}
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
ls -lR
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
2 changes: 1 addition & 1 deletion platformio.ini
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[furble]
build_flags = -D FURBLE_VERSION=\"${sysenv.FURBLE_VERSION}\"
lib_deps =
[email protected].9
[email protected].12
Battery Sense
[email protected]
mikalhart/[email protected]
Expand Down

0 comments on commit 2eeac47

Please sign in to comment.