2023-08-29 13:53:10 +00:00
|
|
|
name: BTClock CI
|
2023-08-29 13:35:33 +00:00
|
|
|
|
|
|
|
on: [push]
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
runs-on: ubuntu-latest
|
2023-08-29 13:53:10 +00:00
|
|
|
permissions:
|
|
|
|
contents: write
|
2023-08-29 13:35:33 +00:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- uses: actions/setup-node@v3
|
|
|
|
with:
|
|
|
|
node-version: lts/*
|
2023-08-29 13:36:16 +00:00
|
|
|
cache: yarn
|
2023-08-29 13:37:22 +00:00
|
|
|
cache-dependency-path: '**/yarn.lock'
|
2023-08-29 13:35:33 +00:00
|
|
|
- uses: actions/cache@v3
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
~/.cache/pip
|
|
|
|
~/.platformio/.cache
|
|
|
|
key: ${{ runner.os }}-pio
|
|
|
|
- uses: actions/setup-python@v4
|
|
|
|
with:
|
|
|
|
python-version: '3.9'
|
|
|
|
- name: Install PlatformIO Core
|
|
|
|
run: pip install --upgrade platformio
|
|
|
|
|
2023-08-29 13:53:10 +00:00
|
|
|
- name: Build BTClock firmware
|
2023-08-29 13:35:33 +00:00
|
|
|
run: pio run -e esp32wemos-s3-mini_BW
|
|
|
|
|
|
|
|
- name: Build BTClock filesystem
|
2023-08-29 13:53:10 +00:00
|
|
|
run: pio run -e esp32wemos-s3-mini_BW --target buildfs
|
2023-08-29 15:03:05 +00:00
|
|
|
|
|
|
|
- name: Install esptools.py
|
|
|
|
run: pip install --upgrade esptool
|
|
|
|
|
|
|
|
- name: Create merged firmware binary
|
2023-10-22 15:04:58 +00:00
|
|
|
run: mkdir -p output && esptool.py --chip esp32s3 merge_bin -o output/full-firmware.bin --flash_mode dio 0x0000 .pio/build/esp32wemos-s3-mini_BW/bootloader.bin 0x8000 .pio/build/esp32wemos-s3-mini_BW/partitions.bin 0xe000 ~/.platformio/packages/framework-arduinoespressif32/tools/partitions/boot_app0.bin 0x10000 .pio/build/esp32wemos-s3-mini_BW/firmware.bin 0x330000 .pio/build/esp32wemos-s3-mini_BW/spiffs.bin
|
2023-08-29 15:03:05 +00:00
|
|
|
|
2023-08-29 13:53:10 +00:00
|
|
|
- name: Upload artifacts
|
|
|
|
uses: actions/upload-artifact@v3
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
.pio/build/esp32wemos-s3-mini_BW/*.bin
|
2023-10-22 15:04:58 +00:00
|
|
|
output/full-firmware.bin
|
2023-08-29 13:53:10 +00:00
|
|
|
|
|
|
|
- name: Create release
|
|
|
|
uses: ncipollo/release-action@v1
|
|
|
|
with:
|
2023-08-29 14:13:04 +00:00
|
|
|
tag: main
|
2023-08-29 14:06:40 +00:00
|
|
|
commit: main
|
2023-10-22 15:04:58 +00:00
|
|
|
artifacts: "output/full-firmware.bin,.pio/build/esp32wemos-s3-mini_BW/*.bin"
|
2023-08-29 14:27:30 +00:00
|
|
|
allowUpdates: true
|
2023-10-22 15:04:58 +00:00
|
|
|
removeArtifacts: 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: output/
|
|
|
|
target-directory: firmware/
|
|
|
|
destination-github-username: 'btclock'
|
|
|
|
destination-repository-name: 'web-flasher'
|
|
|
|
target-branch: btclock
|
|
|
|
user-name: ${GITHUB_ACTOR}
|
|
|
|
user-email: ${GITHUB_ACTOR}@users.noreply.github.com
|