|  | 
| 6 | 6 | env: | 
| 7 | 7 |   FILENAME_PREFIX: RTK_Surveyor_Firmware | 
| 8 | 8 |   FIRMWARE_VERSION_MAJOR: 4 | 
| 9 |  | -  FIRMWARE_VERSION_MINOR: 3 | 
| 10 |  | -  POINTPERFECT_TOKEN: ${{ secrets.POINTPERFECT_TOKEN }} | 
|  | 9 | +  FIRMWARE_VERSION_MINOR: 4 | 
| 11 | 10 |   #We limit the ESP32 core to v2.0.2 | 
| 12 | 11 |   CORE_VERSION: 2.0.2 | 
| 13 | 12 | 
 | 
| @@ -52,114 +51,54 @@ jobs: | 
| 52 | 51 |               echo "DEBUG_LEVEL=debug" >> "$GITHUB_ENV" | 
| 53 | 52 |           fi | 
| 54 | 53 | 
 | 
| 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" | 
| 60 |  | - | 
| 61 |  | -      - name: Update index | 
| 62 |  | -        run: arduino-cli core update-index | 
| 63 |  | - | 
| 64 |  | -      - name: Install platform | 
| 65 |  | -        run: arduino-cli core install esp32:esp32@${{ env.CORE_VERSION }} | 
| 66 |  | - | 
| 67 |  | -      - name: Get Known Libraries | 
| 68 |  | -        run: arduino-cli lib install | 
| 69 |  | - | 
| 70 |  | - | 
| 71 |  | - | 
| 72 |  | -          "ESP32-OTA-Pull"@1.0.0 | 
| 73 |  | - | 
| 74 |  | - | 
| 75 |  | - | 
| 76 |  | -          "SdFat"@2.1.1 | 
| 77 |  | -          "SparkFun LIS2DH12 Arduino Library"@1.0.3 | 
| 78 |  | -          "SparkFun MAX1704x Fuel Gauge Arduino Library"@1.0.4 | 
| 79 |  | -          "SparkFun u-blox GNSS v3"@3.0.14 | 
| 80 |  | - | 
| 81 |  | - | 
| 82 |  | - | 
| 83 |  | -      - name: Enable external libs | 
| 84 |  | -        run: arduino-cli config set library.enable_unsafe_install true | 
| 85 |  | - | 
| 86 |  | -      - name: Get Libraries | 
| 87 |  | -        run: arduino-cli lib install --git-url | 
| 88 |  | -          https://github.com/sparkfun/SparkFun_Qwiic_OLED_Arduino_Library.git | 
| 89 |  | -          https://github.com/me-no-dev/ESPAsyncWebServer.git  | 
| 90 |  | -          https://github.com/me-no-dev/AsyncTCP.git | 
| 91 |  | -           | 
| 92 |  | -      #Incorporate ESP-Now patch into core: https://github.com/espressif/arduino-esp32/pull/7044/files | 
| 93 |  | -      #- name: Patch ESP32 Core | 
| 94 |  | -      #  run: | | 
| 95 |  | -      #    cd Firmware/RTK_Surveyor/Patch/ | 
| 96 |  | -      #    cp WiFiGeneric.cpp /home/runner/.arduino15/packages/esp32/hardware/esp32/${{ env.CORE_VERSION }}/libraries/WiFi/src/WiFiGeneric.cpp | 
| 97 |  | - | 
| 98 |  | -      #Patch Server.h to avoid https://github.com/arduino-libraries/Ethernet/issues/88#issuecomment-455498941 | 
| 99 |  | -      #Note: this patch can be removed if/when we upgrade to ESP32 core >= v2.0.6  | 
| 100 |  | -      - name: Patch ESP32 Server.h for Ethernet | 
| 101 |  | -        run: | | 
| 102 |  | -          cd Firmware/RTK_Surveyor/Patch/ | 
| 103 |  | -          cp Server.h /home/runner/.arduino15/packages/esp32/hardware/esp32/${{ env.CORE_VERSION }}/cores/esp32/Server.h | 
| 104 |  | -
 | 
| 105 |  | -      - name: Setup Python | 
| 106 |  | -        uses: actions/setup-python@v4 | 
| 107 |  | -        with: | 
| 108 |  | -          python-version: '3.10' | 
| 109 |  | - | 
| 110 |  | -      # Configure Python - now we have Python installed, we need to provide everything needed by esptool otherwise the compile fails | 
| 111 |  | -      - name: Configure Python | 
|  | 54 | +      - name: Run Dockerfile and copy files | 
|  | 55 | +        # The --quiet suppresses the build output, keeping the secrets safe | 
| 112 | 56 |         run: | | 
| 113 |  | -          pip3 install pyserial | 
| 114 |  | -
 | 
| 115 |  | -      - name: Update index_html | 
| 116 |  | -        run: | | 
| 117 |  | -          cd Firmware/Tools | 
| 118 |  | -          python index_html_zipper.py ../RTK_Surveyor/AP-Config/index.html ../RTK_Surveyor/form.h | 
| 119 |  | -
 | 
| 120 |  | -      - name: Update main_js | 
| 121 |  | -        run: | | 
| 122 |  | -          cd Firmware/Tools | 
| 123 |  | -          python main_js_zipper.py ../RTK_Surveyor/AP-Config/src/main.js ../RTK_Surveyor/form.h | 
|  | 57 | +          cd ./Firmware | 
|  | 58 | +          echo "*** The docker build is quiet to protect the GitHub secrets ***" | 
|  | 59 | +          docker build -t rtk_firmware --no-cache --quiet \ | 
|  | 60 | +            --build-arg CORE_VERSION=${{ env.CORE_VERSION }} \ | 
|  | 61 | +            --build-arg FIRMWARE_VERSION_MAJOR=${{ env.FIRMWARE_VERSION_MAJOR }} \ | 
|  | 62 | +            --build-arg FIRMWARE_VERSION_MINOR=${{ env.FIRMWARE_VERSION_MINOR }} \ | 
|  | 63 | +            --build-arg POINTPERFECT_TOKEN="${{ secrets.POINTPERFECT_TOKEN }}" \ | 
|  | 64 | +            --build-arg ENABLE_DEVELOPER=${{ env.ENABLE_DEVELOPER }} \ | 
|  | 65 | +            --build-arg DEBUG_LEVEL=${{ env.DEBUG_LEVEL }} \ | 
|  | 66 | +            . | 
|  | 67 | +          docker create --name=rtk_container rtk_firmware:latest | 
|  | 68 | +          mkdir ./build | 
|  | 69 | +          docker cp rtk_container:/RTK_Surveyor.ino.bin ./build | 
|  | 70 | +          docker cp rtk_container:/RTK_Surveyor.ino.elf ./build | 
|  | 71 | +          docker cp rtk_container:/RTK_Surveyor/form.h ./RTK_Surveyor | 
|  | 72 | +          docker container rm rtk_container | 
| 124 | 73 | 
 | 
| 125 | 74 |       - name: Commit and push form.h | 
| 126 |  | -        uses: actions-js/push@master | 
| 127 |  | -        with: | 
| 128 |  | -          github_token: ${{ secrets.GITHUB_TOKEN }} | 
| 129 |  | -          directory: ./Firmware/RTK_Surveyor | 
| 130 |  | -          branch: ${{ env.BRANCH }} | 
| 131 |  | -          message: 'Update form.h via Python' | 
| 132 |  | - | 
| 133 |  | -      - name: Copy custom app3M_fat9M_16MB.csv | 
| 134 |  | -        run: | 
| 135 |  | -          cp Firmware/app3M_fat9M_16MB.csv /home/runner/.arduino15/packages/esp32/hardware/esp32/${{ env.CORE_VERSION }}/tools/partitions/app3M_fat9M_16MB.csv | 
| 136 |  | - | 
| 137 |  | -      - name: Compile Sketch | 
| 138 |  | -        run: arduino-cli compile --fqbn "esp32:esp32:esp32":DebugLevel=${{ env.DEBUG_LEVEL }} ./Firmware/RTK_Surveyor/RTK_Surveyor.ino | 
| 139 |  | -          --build-property build.partitions=app3M_fat9M_16MB | 
| 140 |  | -          --build-property upload.maximum_size=3145728  | 
| 141 |  | -          --build-property "compiler.cpp.extra_flags=\"-DPOINTPERFECT_TOKEN=$POINTPERFECT_TOKEN\" \"-DFIRMWARE_VERSION_MAJOR=$FIRMWARE_VERSION_MAJOR\" \"-DFIRMWARE_VERSION_MINOR=$FIRMWARE_VERSION_MINOR\" \"-DENABLE_DEVELOPER=${{ env.ENABLE_DEVELOPER }}\"" | 
| 142 |  | -          --export-binaries | 
|  | 75 | +        run: | | 
|  | 76 | +          git config --local user.email "github-actions[bot]@users.noreply.github.com" | 
|  | 77 | +          git config --local user.name "github-actions[bot]" | 
|  | 78 | +          git add ./Firmware/RTK_Surveyor/form.h | 
|  | 79 | +          git commit -m "Update form.h via Python" | 
|  | 80 | +          git push origin ${{ env.BRANCH }} | 
|  | 81 | +        env: | 
|  | 82 | +          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | 
| 143 | 83 | 
 | 
| 144 | 84 |       - name: Rename binary | 
| 145 | 85 |         run: | | 
| 146 |  | -          cd Firmware/RTK_Surveyor/build/esp32.esp32.esp32/ | 
|  | 86 | +          cd ./Firmware/build/ | 
| 147 | 87 |           mv RTK_Surveyor.ino.bin ${{ env.FILENAME_PREFIX }}${{ env.FILE_ENDING_UNDERSCORE }}.bin | 
| 148 | 88 | 
 | 
| 149 | 89 |       - name: Upload binary to action | 
| 150 | 90 |         uses: actions/upload-artifact@v4 | 
| 151 | 91 |         with:  | 
| 152 | 92 |           name: ${{ env.FILENAME_PREFIX }}${{ env.FILE_ENDING_UNDERSCORE }} | 
| 153 |  | -          path: ./Firmware/RTK_Surveyor/build/esp32.esp32.esp32/${{ env.FILENAME_PREFIX }}${{ env.FILE_ENDING_UNDERSCORE }}.bin | 
| 154 |  | - | 
|  | 93 | +          path: ./Firmware/build/${{ env.FILENAME_PREFIX }}${{ env.FILE_ENDING_UNDERSCORE }}.bin | 
| 155 | 94 | 
 | 
| 156 | 95 |       - name: Push binary to Binaries Repo | 
| 157 | 96 |         # uses: dmnemec/copy_file_to_another_repo_action #Workaround for Issue: https://github.com/orgs/community/discussions/55820#discussioncomment-5946136 | 
| 158 | 97 |         uses: Jason2866/copy_file_to_another_repo_action@http408_fix | 
| 159 | 98 |         env: | 
| 160 | 99 |           API_TOKEN_GITHUB: ${{ secrets.API_GITHUB_RTK_FILE_TOKEN }} | 
| 161 | 100 |         with: | 
| 162 |  | -          source_file: ./Firmware/RTK_Surveyor/build/esp32.esp32.esp32/${{ env.FILENAME_PREFIX }}${{ env.FILE_ENDING_UNDERSCORE }}.bin | 
|  | 101 | +          source_file: ./Firmware/build/${{ env.FILENAME_PREFIX }}${{ env.FILE_ENDING_UNDERSCORE }}.bin | 
| 163 | 102 |           destination_repo: 'sparkfun/SparkFun_RTK_Firmware_Binaries' | 
| 164 | 103 |           destination_folder: '' | 
| 165 | 104 |  | 
|  | 
0 commit comments