-
-
Notifications
You must be signed in to change notification settings - Fork 1
56 lines (55 loc) · 1.82 KB
/
build_release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
name: Build and Release Firmware - PIO CI
on:
push:
tags:
- 'v*'
jobs:
build:
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v2
- name: Cache pip
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Cache PlatformIO
uses: actions/cache@v2
with:
path: ~/.platformio
key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }}
- name: Set up Python
uses: actions/setup-python@v2
- name: Install PlatformIO
run: |
python -m pip install --upgrade pip
pip install --upgrade platformio
- name: Install ESP Tool
run: python -m pip install esptool
- name: Run PlatformIO Build
run: pio run -e transmitter -e receiver
- name: Merge Receiver Firmware
run: |
cd .pio/build/receiver/
esptool.py --chip esp32 merge_bin -o receiver_fw.bin 0x1000 bootloader.bin 0x8000 partitions.bin 0x10000 firmware.bin
cd -
mv .pio/build/receiver/receiver_fw.bin .
- name: Merge Transmitter Firmware
run: |
cd .pio/build/transmitter/
esptool.py --chip esp32 merge_bin -o transmitter_fw.bin 0x1000 bootloader.bin 0x8000 partitions.bin 0x10000 firmware.bin
cd -
mv .pio/build/transmitter/transmitter_fw.bin .
- name: Set Environment
run: |
git fetch --depth=1 origin +refs/tags/*:refs/tags/*
echo "TAG_MESSAGE=$(git tag -l --format='%(contents:subject)' ${GITHUB_REF#refs/*/})" >> $GITHUB_ENV
- name: Create Release
uses: ncipollo/release-action@v1
with:
artifacts: "transmitter_fw.bin,receiver_fw.bin"