-
-
Notifications
You must be signed in to change notification settings - Fork 115
77 lines (75 loc) · 3.41 KB
/
build.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
name: build
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-20.04
steps:
- name: Install ESP-IDF prerequisite
run: |
sudo add-apt-repository -y "deb http://archive.ubuntu.com/ubuntu `lsb_release -sc` main universe restricted multiverse"
sudo apt-get update -y -qq
sudo apt-get install git wget flex bison gperf python3 python3-pip python3-setuptools cmake ninja-build ccache libffi-dev libssl-dev dfu-util
- name: Set python3 default
run: sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 10 && alias pip=pip3
- name: Clone BlueRetroRoot
run: git clone https://github.com/darthcloud/BlueRetroRoot.git .
- name: Fetch submodules
run: git submodule update --init --recursive
- name: Checkout main repo
working-directory: ./BlueRetro
run: |
git fetch --force https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git "+refs/heads/*:refs/remotes/origin/*"
git fetch --force https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git "+refs/pull/*:refs/remotes/origin/pr/*"
git checkout ${{ github.sha }} || git checkout ${{ github.event.pull_request.head.sha }}
git submodule update --init --recursive
- name: Install ESP-IDF
working-directory: ./esp-idf
run: sh ./install.sh
env:
IDF_TOOLS_PATH : "/home/runner/work/BlueRetro/BlueRetro/BlueRetroRoot/"
- name: Build HW1 with ESP-IDF
working-directory: ./BlueRetro
run: |
. ../esp-idf/export.sh
echo "br_version=$(git describe --always --tags --dirty)" >> $GITHUB_ENV
rm -fr build
for file in configs/hw1/*; do echo "$(git describe --always --tags --dirty) hw1 $(basename $file)" | cut -c -31 > version.txt; cat version.txt; cp configs/hw1/$(basename $file) sdkconfig; BR_HW=_hw1 BR_SYS=_$(basename $file) idf.py reconfigure build; done
env:
IDF_TOOLS_PATH : "/home/runner/work/BlueRetro/BlueRetro/BlueRetroRoot/"
- name: Upload artifact HW1
uses: actions/upload-artifact@v3
with:
name: ${{ env.br_version }}_hw1
path: |
BlueRetro/build/partition_table/partition-table.bin
BlueRetro/build/bootloader/bootloader.bin
BlueRetro/build/BlueRetro*.bin
if-no-files-found: error
- name: Build HW2 with ESP-IDF
working-directory: ./BlueRetro
run: |
. ../esp-idf/export.sh
rm -fr build
for file in configs/hw2/*; do echo "$(git describe --always --tags --dirty) hw2 $(basename $file)" | cut -c -31 > version.txt; cat version.txt; cp configs/hw2/$(basename $file) sdkconfig; BR_HW=_hw2 BR_SYS=_$(basename $file) idf.py reconfigure build; done
env:
IDF_TOOLS_PATH : "/home/runner/work/BlueRetro/BlueRetro/BlueRetroRoot/"
- name: Copy OTA initial binary
working-directory: ./BlueRetro/build
run: |
mkdir ota
mv ota_data_initial.bin ota/
- name: Upload artifact HW2
uses: actions/upload-artifact@v3
with:
name: ${{ env.br_version }}_hw2
path: |
BlueRetro/build/partition_table/partition-table.bin
BlueRetro/build/bootloader/bootloader.bin
BlueRetro/build/ota/ota_data_initial.bin
BlueRetro/build/BlueRetro*.bin
if-no-files-found: error