Non-Release Build #2
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Non-Release Build | |
on: | |
workflow_dispatch: | |
branches: | |
env: | |
FILENAME_PREFIX: RTK_Everywhere_Firmware | |
FIRMWARE_VERSION_MAJOR: 0 | |
FIRMWARE_VERSION_MINOR: 9 | |
POINTPERFECT_LBAND_PAID_TOKEN: ${{ secrets.POINTPERFECT_LBAND_PAID_TOKEN }} | |
POINTPERFECT_LBAND_FREE_TOKEN: ${{ secrets.POINTPERFECT_LBAND_FREE_TOKEN }} | |
POINTPERFECT_IP_FREE_TOKEN: ${{ secrets.POINTPERFECT_IP_FREE_TOKEN }} | |
POINTPERFECT_IP_PAID_TOKEN: ${{ secrets.POINTPERFECT_IP_PAID_TOKEN }} | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@main | |
- name: Get current date | |
id: date | |
run: echo "date=$(date +'%b_%d_%Y')" >> $GITHUB_OUTPUT | |
- name: Get current date | |
id: dateNoScores | |
run: echo "dateNoScores=$(date +'%b %d %Y')" >> $GITHUB_OUTPUT | |
- name: Extract branch name | |
run: echo "BRANCH=${{github.ref_name}}" >> $GITHUB_ENV | |
#File_Name_v1_0.bin | |
#File_Name_RC-Jan_26_2023.bin | |
- name: Create file ending and compiler flags based on branch | |
run: | | |
if [[ $BRANCH == 'main' ]]; then | |
echo "FILE_ENDING_UNDERSCORE=_v${{ env.FIRMWARE_VERSION_MAJOR }}_${{ env.FIRMWARE_VERSION_MINOR }}" >> "$GITHUB_ENV" | |
echo "FILE_ENDING_NOUNDERSCORE=_v${{ env.FIRMWARE_VERSION_MAJOR }}.${{ env.FIRMWARE_VERSION_MINOR }}" >> "$GITHUB_ENV" | |
echo "JSON_ENDING=" >> "$GITHUB_ENV" | |
echo "JSON_FILE_NAME=RTK-Everywhere-Firmware.json" >> "$GITHUB_ENV" | |
echo "ENABLE_DEVELOPER=false" >> "$GITHUB_ENV" | |
echo "DEBUG_LEVEL=none" >> "$GITHUB_ENV" | |
else | |
echo "FILE_ENDING_UNDERSCORE=_RC-${{ steps.date.outputs.date }}" >> "$GITHUB_ENV" | |
echo "FILE_ENDING_NOUNDERSCORE=_RC-${{ steps.dateNoScores.outputs.dateNoScores }}" >> "$GITHUB_ENV" | |
echo "JSON_ENDING=-${{ steps.dateNoScores.outputs.dateNoScores }}" >> "$GITHUB_ENV" | |
echo "JSON_FILE_NAME=RTK-Everywhere-RC-Firmware.json" >> "$GITHUB_ENV" | |
echo "ENABLE_DEVELOPER=true" >> "$GITHUB_ENV" | |
echo "DEBUG_LEVEL=debug" >> "$GITHUB_ENV" | |
fi | |
- name: Setup Arduino CLI | |
uses: arduino/setup-arduino-cli@v1 | |
- name: Start config file | |
run: arduino-cli config init --additional-urls "https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json" | |
- name: Update core index | |
run: arduino-cli core update-index | |
- name: Update library index | |
run: arduino-cli lib update-index | |
- name: Install platform | |
run: arduino-cli core install esp32:[email protected] | |
- name: Get Known Libraries | |
run: arduino-cli lib install | |
[email protected] | |
[email protected] | |
[email protected] | |
"ESP32-OTA-Pull"@1.0.0 | |
[email protected] | |
[email protected] | |
[email protected] | |
"SdFat"@2.1.1 | |
"SparkFun LIS2DH12 Arduino Library"@1.0.3 | |
"SparkFun MAX1704x Fuel Gauge Arduino Library"@1.0.4 | |
"SparkFun u-blox GNSS v3"@3.0.14 | |
[email protected] | |
"SparkFun Qwiic OLED Arduino Library"@1.0.10 | |
[email protected] | |
[email protected] | |
"SparkFun Extensible Message Parser"@1.0.0 | |
"SparkFun BQ40Z50 Battery Manager Arduino Library"@1.0.0 | |
"ArduinoMqttClient"@0.1.8 | |
- name: Enable external libs | |
run: arduino-cli config set library.enable_unsafe_install true | |
- name: Get Libraries | |
run: arduino-cli lib install --git-url | |
https://${{ secrets.GET_PRIVATE_PPL_LIBRARY }}@github.com/sparkfun/SparkFun_u-blox_PointPerfect_Library.git | |
https://${{ secrets.GET_PRIVATE_IM19_LIBRARY }}@github.com/sparkfun/SparkFun_IM19_IMU_Arduino_Library.git | |
https://github.com/sparkfun/SparkFun_Unicore_GNSS_Arduino_Library.git | |
https://github.com/me-no-dev/ESPAsyncWebServer.git | |
https://github.com/me-no-dev/AsyncTCP.git | |
#Incorporate ESP-Now patch into core: https://github.com/espressif/arduino-esp32/pull/7044/files | |
#- name: Patch ESP32 Core | |
# run: | | |
# cd Firmware/RTK_Everywhere/Patch/ | |
# cp WiFiGeneric.cpp /home/runner/.arduino15/packages/esp32/hardware/esp32/2.0.2/libraries/WiFi/src/WiFiGeneric.cpp | |
- name: Setup Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.10' | |
# Configure Python - now we have Python installed, we need to provide everything needed by esptool otherwise the compile fails | |
- name: Configure Python | |
run: | | |
pip3 install pyserial | |
- name: Update index_html | |
run: | | |
cd Firmware/Tools | |
python index_html_zipper.py ../RTK_Everywhere/AP-Config/index.html ../RTK_Everywhere/form.h | |
- name: Update main_js | |
run: | | |
cd Firmware/Tools | |
python main_js_zipper.py ../RTK_Everywhere/AP-Config/src/main.js ../RTK_Everywhere/form.h | |
- name: Commit and push form.h | |
uses: actions-js/push@master | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
directory: ./Firmware/RTK_Everywhere | |
branch: ${{ env.BRANCH }} | |
message: 'Update form.h via Python' | |
- name: Copy custom RTKEverywhere.csv | |
run: | |
cp Firmware/RTKEverywhere.csv /home/runner/.arduino15/packages/esp32/hardware/esp32/2.0.11/tools/partitions/RTKEverywhere.csv | |
- name: Compile Sketch | |
run: arduino-cli compile --fqbn "esp32:esp32:esp32":DebugLevel=${{ env.DEBUG_LEVEL }},PSRAM=enabled ./Firmware/RTK_Everywhere/RTK_Everywhere.ino | |
--build-property build.partitions=RTKEverywhere | |
--build-property upload.maximum_size=3145728 | |
--build-property "compiler.cpp.extra_flags=\"-DPOINTPERFECT_LBAND_PAID_TOKEN=$POINTPERFECT_LBAND_PAID_TOKEN\" \"-DPOINTPERFECT_LBAND_FREE_TOKEN=$POINTPERFECT_LBAND_FREE_TOKEN\" \"-DPOINTPERFECT_IP_PAID_TOKEN=$POINTPERFECT_IP_PAID_TOKEN\" \"-DPOINTPERFECT_IP_FREE_TOKEN=$POINTPERFECT_IP_FREE_TOKEN\" \"-DFIRMWARE_VERSION_MAJOR=$FIRMWARE_VERSION_MAJOR\" \"-DFIRMWARE_VERSION_MINOR=$FIRMWARE_VERSION_MINOR\" \"-DENABLE_DEVELOPER=${{ env.ENABLE_DEVELOPER }}\"" | |
--export-binaries | |
- name: Create artifact name | |
run: | | |
echo "ARTIFACT=${{ env.FILENAME_PREFIX }}${{ env.FILE_ENDING_UNDERSCORE }}" >> $GITHUB_ENV | |
- name: Create artifact directory | |
run: | | |
cd Firmware/RTK_Everywhere/build/esp32.esp32.esp32/ | |
mkdir ${{ env.ARTIFACT }} | |
mv RTK_Everywhere.ino.bin ${{ env.ARTIFACT }} | |
mv RTK_Everywhere.ino.bootloader.bin ${{ env.ARTIFACT }} | |
mv RTK_Everywhere.ino.partitions.bin ${{ env.ARTIFACT }} | |
- name: Upload artifact directory to action - avoid double-zip | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ${{ env.ARTIFACT }} | |
path: Firmware/RTK_Everywhere/build/esp32.esp32.esp32/${{ env.ARTIFACT }} | |
retention-days: 7 |