|
30 | 30 | echo "firmwareMinor=$(grep -Po "(?<=FIRMWARE_VERSION_MINOR = )([0-9])*(?=;$)" ./Firmware/${{ env.FILENAME_PREFIX }}/${{ env.FILENAME_PREFIX }}.ino)" >> "$GITHUB_ENV" |
31 | 31 |
|
32 | 32 | - name: Get firmware version 2 |
33 | | - run: echo "firmwareMajorMinor=-V10-v${{ env.firmwareMajor }}${{ env.firmwareMinor }}" >> "$GITHUB_ENV" |
| 33 | + run: | |
| 34 | + echo "firmwareMajorMinor=-V10-v${{ env.firmwareMajor }}${{ env.firmwareMinor }}" >> "$GITHUB_ENV" |
| 35 | + echo "firmwareMajorMinorX04=-X04-v${{ env.firmwareMajor }}${{ env.firmwareMinor }}" >> "$GITHUB_ENV" |
34 | 36 |
|
35 | 37 | - name: Setup Arduino CLI |
36 | 38 | uses: arduino/setup-arduino-cli@v1 |
@@ -141,6 +143,29 @@ jobs: |
141 | 143 | - name: Disable Power Loss Protection |
142 | 144 | run: sed -i 's|#define noPowerLossProtection|//#define noPowerLossProtection|g' ./Firmware/${{ env.FILENAME_PREFIX }}/${{ env.FILENAME_PREFIX }}.ino |
143 | 145 |
|
| 146 | + - name: X04 Hardware |
| 147 | + run: sed -i 's|#define HARDWARE_VERSION_MAJOR 1|#define HARDWARE_VERSION_MAJOR 0|g' ./Firmware/${{ env.FILENAME_PREFIX }}/${{ env.FILENAME_PREFIX }}.ino |
| 148 | + run: sed -i 's|#define HARDWARE_VERSION_MINOR 0|#define HARDWARE_VERSION_MINOR 4|g' ./Firmware/${{ env.FILENAME_PREFIX }}/${{ env.FILENAME_PREFIX }}.ino |
| 149 | + |
| 150 | + - name: Compile Sketch |
| 151 | + run: arduino-cli compile -v -e -b SparkFun:apollo3:sfe_artemis_atp ./Firmware/${{ env.FILENAME_PREFIX }}/${{ env.FILENAME_PREFIX }}.ino |
| 152 | + |
| 153 | + - name: Rename binary |
| 154 | + run: | |
| 155 | + cd ./Firmware/${{ env.FILENAME_PREFIX }}/build/SparkFun.apollo3.sfe_artemis_atp/ |
| 156 | + mv ${{ env.FILENAME_PREFIX }}.ino.bin ${{ env.FILENAME_PREFIX }}${{ env.firmwareMajorMinor }}-NoPowerLossProtection.bin |
| 157 | + echo "targetBinary=./Firmware/${{ env.FILENAME_PREFIX }}/build/SparkFun.apollo3.sfe_artemis_atp/${{ env.FILENAME_PREFIX }}${{ env.firmwareMajorMinorX04 }}.bin" >> "$GITHUB_ENV" |
| 158 | + rm *.axf |
| 159 | + rm *.hex |
| 160 | + rm *.map |
| 161 | +
|
| 162 | + - name: Move binary |
| 163 | + run: mv ${{ env.targetBinary }} ./Binaries |
| 164 | + |
| 165 | + - name: V01 Hardware |
| 166 | + run: sed -i 's|#define HARDWARE_VERSION_MAJOR 0|#define HARDWARE_VERSION_MAJOR 1|g' ./Firmware/${{ env.FILENAME_PREFIX }}/${{ env.FILENAME_PREFIX }}.ino |
| 167 | + run: sed -i 's|#define HARDWARE_VERSION_MINOR 4|#define HARDWARE_VERSION_MINOR 0|g' ./Firmware/${{ env.FILENAME_PREFIX }}/${{ env.FILENAME_PREFIX }}.ino |
| 168 | + |
144 | 169 | - uses: actions-js/push@master |
145 | 170 | with: |
146 | 171 | github_token: ${{ secrets.GITHUB_TOKEN }} |
|
0 commit comments