Skip to content

Commit 7d5f186

Browse files
committed
Create non-release-build_v3.0.0.yml
1 parent a8cdcf5 commit 7d5f186

File tree

1 file changed

+148
-0
lines changed

1 file changed

+148
-0
lines changed
Lines changed: 148 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,148 @@
1+
name: Non-Release Build
2+
on:
3+
workflow_dispatch:
4+
branches:
5+
6+
env:
7+
FILENAME_PREFIX: RTK_Everywhere_Firmware
8+
FIRMWARE_VERSION_MAJOR: 99
9+
FIRMWARE_VERSION_MINOR: 99
10+
POINTPERFECT_LBAND_TOKEN: ${{ secrets.POINTPERFECT_LBAND_TOKEN }}
11+
POINTPERFECT_IP_TOKEN: ${{ secrets.POINTPERFECT_IP_TOKEN }}
12+
13+
jobs:
14+
build:
15+
16+
name: Build
17+
runs-on: ubuntu-latest
18+
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@main
22+
23+
- name: Get current date
24+
id: date
25+
run: echo "date=$(date +'%b_%d_%Y')" >> $GITHUB_OUTPUT
26+
27+
- name: Get current date
28+
id: dateNoScores
29+
run: echo "dateNoScores=$(date +'%b %d %Y')" >> $GITHUB_OUTPUT
30+
31+
- name: Extract branch name
32+
run: echo "BRANCH=${{github.ref_name}}" >> $GITHUB_ENV
33+
34+
#File_Name_v1_0.bin
35+
#File_Name_RC-Jan_26_2023.bin
36+
- name: Create file ending and compiler flags based on branch
37+
run: |
38+
if [[ $BRANCH == 'main' ]]; then
39+
echo "FILE_ENDING_UNDERSCORE=_v${{ env.FIRMWARE_VERSION_MAJOR }}_${{ env.FIRMWARE_VERSION_MINOR }}" >> "$GITHUB_ENV"
40+
echo "FILE_ENDING_NOUNDERSCORE=_v${{ env.FIRMWARE_VERSION_MAJOR }}.${{ env.FIRMWARE_VERSION_MINOR }}" >> "$GITHUB_ENV"
41+
echo "JSON_ENDING=" >> "$GITHUB_ENV"
42+
echo "JSON_FILE_NAME=RTK-Everywhere-Firmware.json" >> "$GITHUB_ENV"
43+
echo "ENABLE_DEVELOPER=false" >> "$GITHUB_ENV"
44+
echo "DEBUG_LEVEL=none" >> "$GITHUB_ENV"
45+
else
46+
echo "FILE_ENDING_UNDERSCORE=_RC-${{ steps.date.outputs.date }}" >> "$GITHUB_ENV"
47+
echo "FILE_ENDING_NOUNDERSCORE=_RC-${{ steps.dateNoScores.outputs.dateNoScores }}" >> "$GITHUB_ENV"
48+
echo "JSON_ENDING=-${{ steps.dateNoScores.outputs.dateNoScores }}" >> "$GITHUB_ENV"
49+
echo "JSON_FILE_NAME=RTK-Everywhere-RC-Firmware.json" >> "$GITHUB_ENV"
50+
echo "ENABLE_DEVELOPER=true" >> "$GITHUB_ENV"
51+
echo "DEBUG_LEVEL=debug" >> "$GITHUB_ENV"
52+
fi
53+
54+
- name: Setup Arduino CLI
55+
uses: arduino/setup-arduino-cli@v1
56+
57+
- name: Start config file
58+
run: arduino-cli config init --additional-urls "https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json,https://espressif.github.io/arduino-esp32/package_esp32_dev_index.json"
59+
60+
- name: Update core index
61+
run: arduino-cli core update-index
62+
63+
- name: Update library index
64+
run: arduino-cli lib update-index
65+
66+
# We need v3.0.1-rc1 to fix the WiFiMulti.run timeout issue
67+
- name: Install platform
68+
run: arduino-cli core install esp32:[email protected]
69+
70+
- name: Get Known Libraries
71+
run: arduino-cli lib install
72+
73+
74+
75+
"ESP32-OTA-Pull"@1.0.0
76+
77+
78+
"SdFat"@2.1.1
79+
"SparkFun LIS2DH12 Arduino Library"@1.0.3
80+
"SparkFun MAX1704x Fuel Gauge Arduino Library"@1.0.4
81+
"SparkFun u-blox GNSS v3"@3.1.5
82+
"SparkFun Qwiic OLED Arduino Library"@1.0.13
83+
84+
"SparkFun Extensible Message Parser"@1.0.0
85+
"SparkFun BQ40Z50 Battery Manager Arduino Library"@1.0.0
86+
"ArduinoMqttClient"@0.1.8
87+
"SparkFun u-blox PointPerfect Library"@1.11.4
88+
"SparkFun IM19 IMU Arduino Library"@1.0.1
89+
"SparkFun UM980 Triband RTK GNSS Arduino Library"@1.0.4
90+
91+
- name: Enable external libs
92+
run: arduino-cli config set library.enable_unsafe_install true
93+
94+
- name: Setup Python
95+
uses: actions/setup-python@v4
96+
with:
97+
python-version: '3.10'
98+
99+
# Configure Python - now we have Python installed, we need to provide everything needed by esptool otherwise the compile fails
100+
- name: Configure Python
101+
run: |
102+
pip3 install pyserial
103+
104+
- name: Update index_html
105+
run: |
106+
cd Firmware/Tools
107+
python index_html_zipper.py ../RTK_Everywhere/AP-Config/index.html ../RTK_Everywhere/form.h
108+
109+
- name: Update main_js
110+
run: |
111+
cd Firmware/Tools
112+
python main_js_zipper.py ../RTK_Everywhere/AP-Config/src/main.js ../RTK_Everywhere/form.h
113+
114+
- name: Commit and push form.h
115+
uses: actions-js/push@master
116+
with:
117+
github_token: ${{ secrets.GITHUB_TOKEN }}
118+
directory: ./Firmware/RTK_Everywhere
119+
branch: ${{ env.BRANCH }}
120+
message: 'Update form.h via Python'
121+
122+
- name: Copy custom RTKEverywhere.csv
123+
run:
124+
cp Firmware/RTKEverywhere.csv /home/runner/.arduino15/packages/esp32/hardware/esp32/2.0.11/tools/partitions/RTKEverywhere.csv
125+
126+
- name: Compile Sketch
127+
run: arduino-cli compile --fqbn "esp32:esp32:esp32":DebugLevel=${{ env.DEBUG_LEVEL }},PSRAM=enabled ./Firmware/RTK_Everywhere/RTK_Everywhere.ino
128+
--build-property build.partitions=RTKEverywhere
129+
--build-property upload.maximum_size=3145728
130+
--build-property "compiler.cpp.extra_flags=-MMD -c \"-DPOINTPERFECT_LBAND_TOKEN=$POINTPERFECT_LBAND_TOKEN\" \"-DPOINTPERFECT_IP_TOKEN=$POINTPERFECT_IP_TOKEN\" \"-DFIRMWARE_VERSION_MAJOR=$FIRMWARE_VERSION_MAJOR\" \"-DFIRMWARE_VERSION_MINOR=$FIRMWARE_VERSION_MINOR\" \"-DENABLE_DEVELOPER=${{ env.ENABLE_DEVELOPER }}\""
131+
--export-binaries
132+
133+
- name: Create artifact name
134+
run: |
135+
echo "ARTIFACT=${{ env.FILENAME_PREFIX }}${{ env.FILE_ENDING_UNDERSCORE }}" >> $GITHUB_ENV
136+
137+
- name: Create artifact directory
138+
run: |
139+
cd Firmware/RTK_Everywhere/build/esp32.esp32.esp32/
140+
mkdir ${{ env.ARTIFACT }}
141+
mv RTK_Everywhere.ino.bin ${{ env.ARTIFACT }}
142+
143+
- name: Upload artifact directory to action - avoid double-zip
144+
uses: actions/upload-artifact@v3
145+
with:
146+
name: ${{ env.ARTIFACT }}
147+
path: Firmware/RTK_Everywhere/build/esp32.esp32.esp32/${{ env.ARTIFACT }}
148+
retention-days: 7

0 commit comments

Comments
 (0)