66env :
77 FILENAME_PREFIX : RTK_Everywhere_Firmware
88 FIRMWARE_VERSION_MAJOR : 2
9- FIRMWARE_VERSION_MINOR : 2
10- POINTPERFECT_LBAND_TOKEN : ${{ secrets.POINTPERFECT_LBAND_TOKEN }}
11- POINTPERFECT_IP_TOKEN : ${{ secrets.POINTPERFECT_IP_TOKEN }}
12- POINTPERFECT_LBAND_IP_TOKEN : ${{ secrets.POINTPERFECT_LBAND_IP_TOKEN }}
13- POINTPERFECT_RTCM_TOKEN : ${{ secrets.POINTPERFECT_RTCM_TOKEN }}
9+ FIRMWARE_VERSION_MINOR : 3
1410 CORE_VERSION : 3.0.7
1511
1612jobs :
@@ -54,116 +50,49 @@ jobs:
5450 echo "DEBUG_LEVEL=error" >> "$GITHUB_ENV"
5551 fi
5652
57- - name : Setup Arduino CLI
58- uses : arduino/setup-arduino-cli@v1
59-
60- - name : Start config file
61- 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"
62-
63- - name : Update core index
64- run : arduino-cli core update-index
65-
66- - name : Update library index
67- run : arduino-cli lib update-index
68-
69- - name : Install platform
70- run : arduino-cli core install esp32:esp32@${{ env.CORE_VERSION }}
71-
72- - name : Get IDF version
53+ - name : Run Dockerfile and copy files
54+ # The --quiet suppresses the build output, keeping the secrets safe
7355 run : |
74- cd /home/runner/.arduino15/packages/esp32/tools/esp32-arduino-libs
75- IDF_VERSION=$(ls | grep idf-release)
76- echo "ESP_IDF=${IDF_VERSION}" >> "$GITHUB_ENV"
77-
78- - name : Get Known Libraries
79- run : arduino-cli lib install
80- ArduinoJson@7.0.4
81- ESP32Time@2.0.0
82- ESP32_BleSerial@2.0.1
83- " ESP32-OTA-Pull" @1.0.0
84- JC_Button@2.1.2
85- PubSubClient@2.8.0
86- " SdFat" @2.1.1
87- " SparkFun LIS2DH12 Arduino Library" @1.0.3
88- " SparkFun MAX1704x Fuel Gauge Arduino Library" @1.0.4
89- " SparkFun u-blox GNSS v3" @3.1.8
90- " SparkFun Qwiic OLED Arduino Library" @1.0.13
91- SSLClientESP32@2.0.0
92- " SparkFun Extensible Message Parser" @1.0.2
93- " SparkFun BQ40Z50 Battery Manager Arduino Library" @1.0.0
94- " ArduinoMqttClient" @0.1.8
95- " SparkFun u-blox PointPerfect Library" @1.11.4
96- " SparkFun IM19 IMU Arduino Library" @1.0.1
97- " SparkFun UM980 Triband RTK GNSS Arduino Library" @1.0.4
98- " SparkFun LG290P Quadband RTK GNSS Arduino Library" @1.0.8
99- " SparkFun I2C Expander Arduino Library" @1.0.1
100-
101- - name : Patch libmbedtls
102- run : |
103- cd Firmware/RTK_Everywhere/Patch/
104- cp libmbedtls.a /home/runner/.arduino15/packages/esp32/tools/esp32-arduino-libs/${{ env.ESP_IDF }}/esp32/lib/libmbedtls.a
105- cp libmbedtls_2.a /home/runner/.arduino15/packages/esp32/tools/esp32-arduino-libs/${{ env.ESP_IDF }}/esp32/lib/libmbedtls_2.a
106- cp libmbedcrypto.a /home/runner/.arduino15/packages/esp32/tools/esp32-arduino-libs/${{ env.ESP_IDF }}/esp32/lib/libmbedcrypto.a
107- cp libmbedx509.a /home/runner/.arduino15/packages/esp32/tools/esp32-arduino-libs/${{ env.ESP_IDF }}/esp32/lib/libmbedx509.a
108-
109- - name : Patch NetworkEvents
110- run : |
111- cd Firmware/RTK_Everywhere/Patch/
112- cp NetworkEvents.* /home/runner/.arduino15/packages/esp32/hardware/esp32/${{ env.CORE_VERSION }}/libraries/Network/src/
113-
114- - name : Setup Python
115- uses : actions/setup-python@v4
116- with :
117- python-version : ' 3.10'
118-
119- # Configure Python - now we have Python installed, we need to provide everything needed by esptool otherwise the compile fails
120- - name : Configure Python
121- run : |
122- pip3 install pyserial
123-
124- - name : Update index_html
125- run : |
126- cd Firmware/Tools
127- python index_html_zipper.py ../RTK_Everywhere/AP-Config/index.html ../RTK_Everywhere/form.h
128-
129- - name : Update main_js
130- run : |
131- cd Firmware/Tools
132- python main_js_zipper.py ../RTK_Everywhere/AP-Config/src/main.js ../RTK_Everywhere/form.h
56+ cd ./Firmware
57+ echo "*** The docker build is quiet to protect the GitHub secrets ***"
58+ docker build -t rtk_everywhere_firmware --no-cache --quiet \
59+ --build-arg CORE_VERSION=${{ env.CORE_VERSION }} \
60+ --build-arg FIRMWARE_VERSION_MAJOR=${{ env.FIRMWARE_VERSION_MAJOR }} \
61+ --build-arg FIRMWARE_VERSION_MINOR=${{ env.FIRMWARE_VERSION_MINOR }} \
62+ --build-arg POINTPERFECT_LBAND_TOKEN="${{ secrets.POINTPERFECT_LBAND_TOKEN }}" \
63+ --build-arg POINTPERFECT_IP_TOKEN="${{ secrets.POINTPERFECT_IP_TOKEN }}" \
64+ --build-arg POINTPERFECT_LBAND_IP_TOKEN="${{ secrets.POINTPERFECT_LBAND_IP_TOKEN }}" \
65+ --build-arg POINTPERFECT_RTCM_TOKEN="${{ secrets.POINTPERFECT_RTCM_TOKEN }}" \
66+ --build-arg ENABLE_DEVELOPER=${{ env.ENABLE_DEVELOPER }} \
67+ --build-arg DEBUG_LEVEL=${{ env.DEBUG_LEVEL }} \
68+ .
69+ docker create --name=rtk_everywhere rtk_everywhere_firmware:latest
70+ mkdir ./build
71+ docker cp rtk_everywhere:/RTK_Everywhere.ino.bin ./build
72+ docker cp rtk_everywhere:/RTK_Everywhere.ino.elf ./build
73+ docker cp rtk_everywhere:/RTK_Everywhere/form.h ./RTK_Everywhere
74+ docker container rm rtk_everywhere
13375
13476 - name : Commit and push form.h
135- uses : actions-js/push@master
136- with :
137- github_token : ${{ secrets.GITHUB_TOKEN }}
138- directory : ./Firmware/RTK_Everywhere
139- branch : ${{ env.BRANCH }}
140- message : ' Update form.h via Python'
141-
142- - name : Copy custom RTKEverywhere.csv
143- run :
144- # Compile the source using the 16MB partition file. Other platforms (ie, the 8MB Postcard) use
145- # the same binary but use a different partition binary during the upload phase.
146- # View the different RTK partition files used during upload here:
147- # https://github.com/sparkfun/SparkFun_RTK_Firmware_Uploader/tree/main/RTK_Firmware_Uploader/resource
148- cp Firmware/RTKEverywhere.csv /home/runner/.arduino15/packages/esp32/hardware/esp32/${{ env.CORE_VERSION }}/tools/partitions/RTKEverywhere.csv
149-
150- - name : Compile Sketch
151- run : arduino-cli compile --fqbn "esp32:esp32:esp32":DebugLevel=${{ env.DEBUG_LEVEL }},PSRAM=enabled ./Firmware/RTK_Everywhere/RTK_Everywhere.ino
152- --build-property build.partitions=RTKEverywhere
153- --build-property upload.maximum_size=4055040
154- --build-property "compiler.cpp.extra_flags=-MMD -c \"-DPOINTPERFECT_LBAND_TOKEN=$POINTPERFECT_LBAND_TOKEN\" \"-DPOINTPERFECT_IP_TOKEN=$POINTPERFECT_IP_TOKEN\" \"-DPOINTPERFECT_LBAND_IP_TOKEN=$POINTPERFECT_LBAND_IP_TOKEN\" \"-DPOINTPERFECT_RTCM_TOKEN=$POINTPERFECT_RTCM_TOKEN\" \"-DFIRMWARE_VERSION_MAJOR=$FIRMWARE_VERSION_MAJOR\" \"-DFIRMWARE_VERSION_MINOR=$FIRMWARE_VERSION_MINOR\" \"-DENABLE_DEVELOPER=${{ env.ENABLE_DEVELOPER }}\""
155- --export-binaries
77+ run : |
78+ git config --local user.email "github-actions[bot]@users.noreply.github.com"
79+ git config --local user.name "github-actions[bot]"
80+ git add ./Firmware/RTK_Everywhere/form.h
81+ git commit -m "Update form.h via Python"
82+ git push origin ${{ env.BRANCH }}
83+ env :
84+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
15685
15786 - name : Rename binary
15887 run : |
159- cd Firmware/RTK_Everywhere/ build/esp32.esp32.esp32/
88+ cd ./ Firmware/build
16089 mv RTK_Everywhere.ino.bin ${{ env.FILENAME_PREFIX }}${{ env.FILE_ENDING_UNDERSCORE }}.bin
16190
16291 - name : Upload binary to action
16392 uses : actions/upload-artifact@v4
16493 with :
16594 name : ${{ env.FILENAME_PREFIX }}${{ env.FILE_ENDING_UNDERSCORE }}
166- path : ./Firmware/RTK_Everywhere/ build/esp32.esp32.esp32 /${{ env.FILENAME_PREFIX }}${{ env.FILE_ENDING_UNDERSCORE }}.bin
95+ path : ./Firmware/build/${{ env.FILENAME_PREFIX }}${{ env.FILE_ENDING_UNDERSCORE }}.bin
16796
16897
16998 - name : Push binary to Binaries Repo
@@ -172,7 +101,7 @@ jobs:
172101 env :
173102 API_TOKEN_GITHUB : ${{ secrets.PUSH_BINARIES_REPO }}
174103 with :
175- source_file : ./Firmware/RTK_Everywhere/ build/esp32.esp32.esp32 /${{ env.FILENAME_PREFIX }}${{ env.FILE_ENDING_UNDERSCORE }}.bin
104+ source_file : ./Firmware/build/${{ env.FILENAME_PREFIX }}${{ env.FILE_ENDING_UNDERSCORE }}.bin
176105 destination_repo : ' sparkfun/SparkFun_RTK_Everywhere_Firmware_Binaries'
177106 destination_folder : ' '
178107 user_email : ' nathan@sparkfun.com'
0 commit comments