Skip to content

Commit 610e77d

Browse files
committed
Add X04 binary
1 parent 42c89a1 commit 610e77d

File tree

1 file changed

+26
-1
lines changed

1 file changed

+26
-1
lines changed

.github/workflows/build-for-release.yml

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ jobs:
3030
echo "firmwareMinor=$(grep -Po "(?<=FIRMWARE_VERSION_MINOR = )([0-9])*(?=;$)" ./Firmware/${{ env.FILENAME_PREFIX }}/${{ env.FILENAME_PREFIX }}.ino)" >> "$GITHUB_ENV"
3131
3232
- 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"
3436
3537
- name: Setup Arduino CLI
3638
uses: arduino/setup-arduino-cli@v1
@@ -141,6 +143,29 @@ jobs:
141143
- name: Disable Power Loss Protection
142144
run: sed -i 's|#define noPowerLossProtection|//#define noPowerLossProtection|g' ./Firmware/${{ env.FILENAME_PREFIX }}/${{ env.FILENAME_PREFIX }}.ino
143145

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+
144169
- uses: actions-js/push@master
145170
with:
146171
github_token: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)