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