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