Skip to content

Commit f69a73f

Browse files
committed
Update build-for-release.yml - to use Dockerfile
1 parent 95f8312 commit f69a73f

File tree

1 file changed

+9
-126
lines changed

1 file changed

+9
-126
lines changed

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

Lines changed: 9 additions & 126 deletions
Original file line numberDiff line numberDiff line change
@@ -34,141 +34,24 @@ jobs:
3434
echo "firmwareMajorMinor=-V10-v${{ env.firmwareMajor }}${{ env.firmwareMinor }}" >> "$GITHUB_ENV"
3535
echo "firmwareMajorMinorX04=-X04-v${{ env.firmwareMajor }}${{ env.firmwareMinor }}" >> "$GITHUB_ENV"
3636
37-
- name: Setup Arduino CLI
38-
uses: arduino/setup-arduino-cli@v1
39-
40-
- name: Start config file
41-
run: arduino-cli config init --additional-urls "https://raw.githubusercontent.com/sparkfun/Arduino_Apollo3/main/package_sparkfun_apollo3_index.json"
42-
43-
- name: Update index
44-
run: arduino-cli core update-index
45-
46-
- name: Install platform
47-
run: arduino-cli core install "Sparkfun:[email protected]"
48-
49-
- name: Get Known Libraries
50-
run: arduino-cli lib install
51-
52-
"SparkFun 9DoF IMU Breakout - ICM 20948 - Arduino Library"
53-
"SparkFun I2C Mux Arduino Library"
54-
"SparkFun CCS811 Arduino Library"
55-
"SparkFun VL53L1X 4m Laser Distance Sensor"
56-
"SparkFun BME280"
57-
"SparkFun LPS25HB Pressure Sensor Library"
58-
"SparkFun VEML6075 Arduino Library"
59-
"SparkFun PHT MS8607 Arduino Library"
60-
"SparkFun MCP9600 Thermocouple Library"
61-
"SparkFun SGP30 Arduino Library"
62-
"SparkFun VCNL4040 Proximity Sensor Library"
63-
"SparkFun MS5637 Barometric Pressure Library"
64-
"SparkFun High Precision Temperature Sensor TMP117 Qwiic"
65-
"SparkFun u-blox GNSS Arduino Library"
66-
"SparkFun 6DoF ISM330DHCX"
67-
"SparkFun Qwiic Scale NAU7802 Arduino Library"
68-
"SparkFun SCD30 Arduino Library"
69-
"SparkFun Qwiic Humidity AHT20"
70-
"SparkFun SHTC3 Humidity and Temperature Sensor Library"
71-
"SparkFun ADS122C04 ADC Arduino Library"
72-
"SparkFun MicroPressure Library"
73-
"SparkFun Particle Sensor Panasonic SN-GCJA5"
74-
"SparkFun SGP40 Arduino Library"
75-
"SparkFun Qwiic Button and Qwiic Switch Library"
76-
"SparkFun Bio Sensor Hub Library"
77-
"SparkFun MMC5983MA Magnetometer Arduino Library"
78-
"SparkFun ADS1015 Arduino Library"
79-
"SparkFun KX13X Arduino Library"
80-
"SparkFun SDP3x Arduino Library"
81-
"SparkFun LPS28DFW Arduino Library"
82-
"SparkFun VEML7700 Arduino Library"
83-
"SparkFun TMP102 Breakout"
84-
85-
- name: Enable external libs
86-
run: arduino-cli config set library.enable_unsafe_install true
87-
88-
- name: Get Libraries
89-
run: arduino-cli lib install --git-url
90-
https://github.com/bluerobotics/BlueRobotics_MS5837_Library.git
91-
92-
- name: Enable ICM20948 DMP
93-
run: sed -i 's|//#define ICM_20948_USE_DMP|#define ICM_20948_USE_DMP|g' /home/runner/Arduino/libraries/SparkFun_9DoF_IMU_Breakout_-_ICM_20948_-_Arduino_Library/src/util/ICM_20948_C.h
94-
95-
- name: Patch Apollo3 Core
37+
- name: Run Dockerfile and copy files
9638
run: |
97-
cd ./Extras
98-
unzip UartPower3.zip
99-
cp HardwareSerial.h /home/runner/.arduino15/packages/SparkFun/hardware/apollo3/2.2.1/cores/arduino/mbed-bridge/core-extend/HardwareSerial.h
100-
cp HardwareSerial.cpp /home/runner/.arduino15/packages/SparkFun/hardware/apollo3/2.2.1/cores/arduino/mbed-bridge/core-implement/HardwareSerial.cpp
101-
cp UnbufferedSerial.h /home/runner/.arduino15/packages/SparkFun/hardware/apollo3/2.2.1/cores/mbed-os/drivers/UnbufferedSerial.h
102-
cp serial_api.c /home/runner/.arduino15/packages/SparkFun/hardware/apollo3/2.2.1/cores/mbed-os/targets/TARGET_Ambiq_Micro/TARGET_Apollo3/device/serial_api.c
103-
cp libmbed-os.a /home/runner/.arduino15/packages/SparkFun/hardware/apollo3/2.2.1/variants/SFE_ARTEMIS_ATP/mbed/libmbed-os.a
104-
cp SPI.cpp /home/runner/.arduino15/packages/SparkFun/hardware/apollo3/2.2.1/libraries/SPI/src/SPI.cpp
105-
rm *.h
106-
rm *.cpp
107-
rm *.a
108-
rm *.c
109-
rm *.odt
110-
111-
- name: Compile Sketch
112-
run: arduino-cli compile -v -e -b SparkFun:apollo3:sfe_artemis_atp ./Firmware/${{ env.FILENAME_PREFIX }}/${{ env.FILENAME_PREFIX }}.ino
39+
cd ./Firmware
40+
docker build -t openlog_artemis_image --no-cache .
41+
docker create --name=openlog_artemis_container openlog_artemis_image:latest
42+
mkdir ./build
43+
docker cp openlog_artemis_container:/${{ env.FILENAME_PREFIX }}.ino.bin ./build
44+
docker container rm openlog_artemis_container
11345
11446
- name: Rename binary
11547
run: |
116-
cd ./Firmware/${{ env.FILENAME_PREFIX }}/build/SparkFun.apollo3.sfe_artemis_atp/
48+
cd ./Firmware/build/
11749
mv ${{ env.FILENAME_PREFIX }}.ino.bin ${{ env.FILENAME_PREFIX }}${{ env.firmwareMajorMinor }}.bin
118-
echo "targetBinary=./Firmware/${{ env.FILENAME_PREFIX }}/build/SparkFun.apollo3.sfe_artemis_atp/${{ env.FILENAME_PREFIX }}${{ env.firmwareMajorMinor }}.bin" >> "$GITHUB_ENV"
119-
rm *.axf
120-
rm *.hex
121-
rm *.map
50+
echo "targetBinary=./Firmware/build/${{ env.FILENAME_PREFIX }}${{ env.firmwareMajorMinor }}.bin" >> "$GITHUB_ENV"
12251
12352
- name: Move binary
12453
run: mv ${{ env.targetBinary }} ./Binaries
12554

126-
- name: Enable Power Loss Protection
127-
run: sed -i 's|//#define noPowerLossProtection|#define noPowerLossProtection|g' ./Firmware/${{ env.FILENAME_PREFIX }}/${{ env.FILENAME_PREFIX }}.ino
128-
129-
- name: Compile Sketch
130-
run: arduino-cli compile -v -e -b SparkFun:apollo3:sfe_artemis_atp ./Firmware/${{ env.FILENAME_PREFIX }}/${{ env.FILENAME_PREFIX }}.ino
131-
132-
- name: Rename binary
133-
run: |
134-
cd ./Firmware/${{ env.FILENAME_PREFIX }}/build/SparkFun.apollo3.sfe_artemis_atp/
135-
mv ${{ env.FILENAME_PREFIX }}.ino.bin ${{ env.FILENAME_PREFIX }}${{ env.firmwareMajorMinor }}-NoPowerLossProtection.bin
136-
echo "targetBinary=./Firmware/${{ env.FILENAME_PREFIX }}/build/SparkFun.apollo3.sfe_artemis_atp/${{ env.FILENAME_PREFIX }}${{ env.firmwareMajorMinor }}-NoPowerLossProtection.bin" >> "$GITHUB_ENV"
137-
rm *.axf
138-
rm *.hex
139-
rm *.map
140-
141-
- name: Move binary
142-
run: mv ${{ env.targetBinary }} ./Binaries
143-
144-
- name: Disable Power Loss Protection
145-
run: sed -i 's|#define noPowerLossProtection|//#define noPowerLossProtection|g' ./Firmware/${{ env.FILENAME_PREFIX }}/${{ env.FILENAME_PREFIX }}.ino
146-
147-
- name: X04 Hardware
148-
run: |
149-
sed -i 's|#define HARDWARE_VERSION_MAJOR 1|#define HARDWARE_VERSION_MAJOR 0|g' ./Firmware/${{ env.FILENAME_PREFIX }}/${{ env.FILENAME_PREFIX }}.ino
150-
sed -i 's|#define HARDWARE_VERSION_MINOR 0|#define HARDWARE_VERSION_MINOR 4|g' ./Firmware/${{ env.FILENAME_PREFIX }}/${{ env.FILENAME_PREFIX }}.ino
151-
152-
- name: Compile Sketch
153-
run: arduino-cli compile -v -e -b SparkFun:apollo3:sfe_artemis_atp ./Firmware/${{ env.FILENAME_PREFIX }}/${{ env.FILENAME_PREFIX }}.ino
154-
155-
- name: Rename binary
156-
run: |
157-
cd ./Firmware/${{ env.FILENAME_PREFIX }}/build/SparkFun.apollo3.sfe_artemis_atp/
158-
mv ${{ env.FILENAME_PREFIX }}.ino.bin ${{ env.FILENAME_PREFIX }}${{ env.firmwareMajorMinorX04 }}.bin
159-
echo "targetBinary=./Firmware/${{ env.FILENAME_PREFIX }}/build/SparkFun.apollo3.sfe_artemis_atp/${{ env.FILENAME_PREFIX }}${{ env.firmwareMajorMinorX04 }}.bin" >> "$GITHUB_ENV"
160-
rm *.axf
161-
rm *.hex
162-
rm *.map
163-
164-
- name: Move binary
165-
run: mv ${{ env.targetBinary }} ./Binaries
166-
167-
- name: V01 Hardware
168-
run: |
169-
sed -i 's|#define HARDWARE_VERSION_MAJOR 0|#define HARDWARE_VERSION_MAJOR 1|g' ./Firmware/${{ env.FILENAME_PREFIX }}/${{ env.FILENAME_PREFIX }}.ino
170-
sed -i 's|#define HARDWARE_VERSION_MINOR 4|#define HARDWARE_VERSION_MINOR 0|g' ./Firmware/${{ env.FILENAME_PREFIX }}/${{ env.FILENAME_PREFIX }}.ino
171-
17255
- uses: actions-js/push@master
17356
with:
17457
github_token: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)