Make BTClock v8 board working again #64
Workflow file for this run
This file contains 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: BTClock CI | |
on: | |
push: | |
tags: | |
- "*" | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
checks: write | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: "Install and build" | |
uses: ./.github/actions/install-build | |
- name: Copy bootloader to output folder | |
run: cp ~/.platformio/packages/framework-arduinoespressif32/tools/partitions/boot_app0.bin .pio | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
include-hidden-files: true | |
retention-days: 1 | |
name: prepared-outputs | |
path: .pio/**/*.bin | |
merge: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
checks: write | |
needs: build | |
continue-on-error: true | |
strategy: | |
matrix: | |
chip: | |
- name: lolin_s3_mini | |
version: esp32s3 | |
- name: btclock_rev_b | |
version: esp32s3 | |
- name: btclock_v8 | |
version: esp32s3 | |
epd_variant: [213epd, 29epd] | |
exclude: | |
- chip: btclock_rev_b | |
epd_variant: 29epd | |
- chip: btclock_v8 | |
epd_variant: 29epd | |
steps: | |
- uses: actions/download-artifact@v4 | |
with: | |
name: prepared-outputs | |
path: .pio | |
- name: Install esptools.py | |
run: pip install --upgrade esptool | |
# - name: Create merged firmware binary | |
# run: mkdir -p ${{ matrix.chip.name }}_${{ matrix.epd_variant }} && esptool.py --chip ${{ matrix.chip.version }} merge_bin -o ${{ matrix.chip.name }}_${{ matrix.epd_variant }}/${{ matrix.chip.name }}_${{ matrix.epd_variant }}.bin --flash_mode dio 0x0000 .pio/build/${{ matrix.chip.name }}_${{ matrix.epd_variant }}/bootloader.bin 0x8000 .pio/build/${{ matrix.chip.name }}_${{ matrix.epd_variant }}/partitions.bin 0xe000 .pio/boot_app0.bin 0x10000 .pio/build/${{ matrix.chip.name }}_${{ matrix.epd_variant }}/firmware.bin 0x369000 .pio/build/${{ matrix.chip.name }}_${{ matrix.epd_variant }}/littlefs.bin | |
- name: Create merged firmware binary | |
run: | | |
if [ "${{ matrix.chip.name }}" == "btclock_v8" ]; then | |
mkdir -p ${{ matrix.chip.name }}_${{ matrix.epd_variant }} && \ | |
esptool.py --chip ${{ matrix.chip.version }} merge_bin \ | |
-o ${{ matrix.chip.name }}_${{ matrix.epd_variant }}/${{ matrix.chip.name }}_${{ matrix.epd_variant }}.bin \ | |
--flash_mode qio \ | |
0x0000 .pio/build/${{ matrix.chip.name }}_${{ matrix.epd_variant }}/bootloader.bin \ | |
0x8000 .pio/build/${{ matrix.chip.name }}_${{ matrix.epd_variant }}/partitions.bin \ | |
0xe000 .pio/boot_app0.bin \ | |
0x10000 .pio/build/${{ matrix.chip.name }}_${{ matrix.epd_variant }}/firmware.bin \ | |
0x810000 .pio/build/${{ matrix.chip.name }}_${{ matrix.epd_variant }}/littlefs.bin; | |
else | |
# Original command for other cases | |
mkdir -p ${{ matrix.chip.name }}_${{ matrix.epd_variant }} && \ | |
esptool.py --chip ${{ matrix.chip.version }} merge_bin \ | |
-o ${{ matrix.chip.name }}_${{ matrix.epd_variant }}/${{ matrix.chip.name }}_${{ matrix.epd_variant }}.bin \ | |
--flash_mode dio \ | |
0x0000 .pio/build/${{ matrix.chip.name }}_${{ matrix.epd_variant }}/bootloader.bin \ | |
0x8000 .pio/build/${{ matrix.chip.name }}_${{ matrix.epd_variant }}/partitions.bin \ | |
0xe000 .pio/boot_app0.bin \ | |
0x10000 .pio/build/${{ matrix.chip.name }}_${{ matrix.epd_variant }}/firmware.bin \ | |
0x369000 .pio/build/${{ matrix.chip.name }}_${{ matrix.epd_variant }}/littlefs.bin | |
# Adjust the offset for littlefs or other files as needed for the original case | |
fi | |
- name: Create checksum for firmware | |
run: shasum -a 256 .pio/build/${{ matrix.chip.name }}_${{ matrix.epd_variant }}/firmware.bin | awk '{print $1}' > ${{ matrix.chip.name }}_${{ matrix.epd_variant }}/${{ matrix.chip.name }}_${{ matrix.epd_variant }}_firmware.bin.sha256 | |
- name: Create checksum for merged binary | |
run: shasum -a 256 ${{ matrix.chip.name }}_${{ matrix.epd_variant }}/${{ matrix.chip.name }}_${{ matrix.epd_variant }}.bin | awk '{print $1}' > ${{ matrix.chip.name }}_${{ matrix.epd_variant }}/${{ matrix.chip.name }}_${{ matrix.epd_variant }}.bin.sha256 | |
- name: Create checksum for littlefs partition | |
run: shasum -a 256 .pio/build/${{ matrix.chip.name }}_${{ matrix.epd_variant }}/littlefs.bin | awk '{print $1}' > ${{ matrix.chip.name }}_${{ matrix.epd_variant }}/littlefs.bin.sha256 | |
- name: Copy all artifacts to output folder | |
run: cp .pio/build/${{ matrix.chip.name }}_${{ matrix.epd_variant }}/*.bin .pio/boot_app0.bin ${{ matrix.chip.name }}_${{ matrix.epd_variant }} | |
- name: Create OTA binary file | |
run: mv ${{ matrix.chip.name }}_${{ matrix.epd_variant }}/firmware.bin ${{ matrix.chip.name }}_${{ matrix.epd_variant }}/${{ matrix.chip.name }}_${{ matrix.epd_variant }}_firmware.bin | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: build-${{ matrix.chip.name }}-${{ matrix.epd_variant }} | |
path: | | |
${{ matrix.chip.name }}_${{ matrix.epd_variant }}/*.bin | |
${{ matrix.chip.name }}_${{ matrix.epd_variant }}/*.sha256 | |
release: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
checks: write | |
needs: merge | |
steps: | |
- name: Download matrix outputs | |
uses: actions/download-artifact@v4 | |
with: | |
pattern: build-* | |
merge-multiple: false | |
- name: Write commit hash to file | |
run: echo $GITHUB_SHA > commit.txt | |
- name: Write build date to file | |
run: echo "$(date -u +'%Y-%m-%dT%H:%M:%SZ')" > date.txt | |
- name: Create release | |
uses: ncipollo/release-action@v1 | |
with: | |
artifacts: "**/*.bin,**/*.sha256" | |
allowUpdates: true | |
removeArtifacts: true | |
makeLatest: true | |
# - name: Create release | |
# uses: ncipollo/release-action@v1 | |
# with: | |
# artifacts: "output/full-firmware.bin,output/full-firmware.sha256,.pio/build/lolin_s3_mini_qr/*.bin" | |
# allowUpdates: true | |
# removeArtifacts: true | |
# makeLatest: true | |
- name: Pushes full-firmware.bin to web flasher | |
id: push_directory | |
uses: cpina/github-action-push-to-another-repository@main | |
env: | |
SSH_DEPLOY_KEY: ${{ secrets.SSH_DEPLOY_KEY }} | |
with: | |
source-directory: . | |
target-directory: firmware_v3/ | |
destination-github-username: "btclock" | |
destination-repository-name: "web-flasher" | |
target-branch: main | |
user-name: ${{github.actor}} | |
user-email: ${{github.actor}}@users.noreply.github.com |