-
Notifications
You must be signed in to change notification settings - Fork 2
170 lines (157 loc) · 6.25 KB
/
build_platformio.yaml
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
# This is a basic workflow to help you get started with Actions
name: Compile ESP32 Platformio
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- uses: actions/checkout@v2
with:
ref: main
submodules: recursive
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.9'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install platformio
pip install esptool
dir
# It is important to first install the libraries before compiling, since otherwise compilation might fail to find the just-installed libraries
- name: Install platformIO libraries
run: pio lib install
# run for WEMOS => pindef.h
- name: Find and Replace (LOG LEVEL)
uses: jacobtomlinson/gha-find-replace@v2
with:
find: "-DCORE_DEBUG_LEVEL=5"
replace: "-DCORE_DEBUG_LEVEL=0"
regex: false
- name: Find and Replace (UC2-WEMOS)
uses: jacobtomlinson/gha-find-replace@v2
with:
find: "const UC2"
replace: "const UC2_WEMOS pinConfig; //"
regex: false
- name: Run PlatformIO
run: pio run
- name: merge into one binary
run: |
dir .pio/build/esp32dev/
mv .pio/build/esp32dev/*.bin build/
cd build
python -m esptool --chip esp32 merge_bin -o esp32_wemos.bin --flash_mode dio --flash_freq 40m --flash_size 4MB 0x1000 bootloader.bin 0x8000 partitions.bin 0xe000 boot_app0.bin 0x10000 firmware.bin
- uses: actions/upload-artifact@v3
with:
name: merged-firmware
path: build/merged-firmware.bin
- name: Push to youseetoo Webtool
uses: dmnemec/copy_file_to_another_repo_action@main
env:
API_TOKEN_GITHUB: ${{ secrets.API_TOKEN_GITHUB }}
with:
source_file: 'build/esp32_wemos.bin'
destination_repo: 'youseetoo/youseetoo.github.io'
destination_folder: 'static/firmware_build'
user_email: '[email protected]'
user_name: 'beniroquai'
commit_message: 'A new firmware binary has been released => https://github.com/youseetoo/uc2-esp32'
# run for uc2-standalone-v1
- name: Find and Replace (UC2-1)
uses: jacobtomlinson/gha-find-replace@v2
with:
find: "const UC2"
replace: "const UC2_1 pinConfig; //"
regex: false
- name: Run PlatformIO
run: pio run
- name: merge into one binary
run: |
dir .pio/build/esp32dev/
mv .pio/build/esp32dev/*.bin build/
cd build
python -m esptool --chip esp32 merge_bin -o esp32_uc2_1.bin --flash_mode dio --flash_freq 40m --flash_size 4MB 0x1000 bootloader.bin 0x8000 partitions.bin 0xe000 boot_app0.bin 0x10000 firmware.bin
- uses: actions/upload-artifact@v3
with:
name: merged-firmware
path: build/esp32_uc2_1.bin
- name: Push to youseetoo Webtool
uses: dmnemec/copy_file_to_another_repo_action@main
env:
API_TOKEN_GITHUB: ${{ secrets.API_TOKEN_GITHUB }}
with:
source_file: 'build/esp32_uc2_1.bin'
destination_repo: 'youseetoo/youseetoo.github.io'
destination_folder: 'static/firmware_build'
user_email: '[email protected]'
user_name: 'beniroquai'
commit_message: 'A new firmware binary has been released => https://github.com/youseetoo/uc2-esp32'
# run for uc2-standalone-v2
- name: Find and Replace (UC2-2)
uses: jacobtomlinson/gha-find-replace@v2
with:
find: "const UC2"
replace: "const UC2_2 pinConfig; //"
regex: false
- name: Run PlatformIO
run: pio run
- name: merge into one binary
run: |
dir .pio/build/esp32dev/
mv .pio/build/esp32dev/*.bin build/
cd build
python -m esptool --chip esp32 merge_bin -o esp32_uc2_2.bin --flash_mode dio --flash_freq 40m --flash_size 4MB 0x1000 bootloader.bin 0x8000 partitions.bin 0xe000 boot_app0.bin 0x10000 firmware.bin
- uses: actions/upload-artifact@v3
with:
name: merged-firmware
path: build/esp32_uc2_2.bin
- name: Push to youseetoo Webtool
uses: dmnemec/copy_file_to_another_repo_action@main
env:
API_TOKEN_GITHUB: ${{ secrets.API_TOKEN_GITHUB }}
with:
source_file: 'build/esp32_uc2_2.bin'
destination_repo: 'youseetoo/youseetoo.github.io'
destination_folder: 'static/firmware_build'
user_email: '[email protected]'
user_name: 'beniroquai'
commit_message: 'A new firmware binary has been released => https://github.com/youseetoo/uc2-esp32'
# run for uc2-standalone-v3
- name: Find and Replace (UC2-3)
uses: jacobtomlinson/gha-find-replace@v2
with:
find: "const UC2"
replace: "const UC2_3 pinConfig; //"
regex: false
- name: Run PlatformIO
run: pio run
- name: merge into one binary
run: |
dir .pio/build/esp32dev/
mv .pio/build/esp32dev/*.bin build/
cd build
python -m esptool --chip esp32 merge_bin -o esp32_uc2_3.bin --flash_mode dio --flash_freq 40m --flash_size 4MB 0x1000 bootloader.bin 0x8000 partitions.bin 0xe000 boot_app0.bin 0x10000 firmware.bin
- uses: actions/upload-artifact@v3
with:
name: merged-firmware
path: build/esp32_uc2_3.bin
- name: Push to youseetoo Webtool
uses: dmnemec/copy_file_to_another_repo_action@main
env:
API_TOKEN_GITHUB: ${{ secrets.API_TOKEN_GITHUB }}
with:
source_file: 'build/esp32_uc2_3.bin'
destination_repo: 'youseetoo/youseetoo.github.io'
destination_folder: 'static/firmware_build'
user_email: '[email protected]'
user_name: 'beniroquai'
commit_message: 'A new firmware binary has been released => https://github.com/youseetoo/uc2-esp32'