-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
231 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,147 @@ | ||
# Workflow that builds the firmware, and adds the binary to the ./Binaries folder, ready for release. | ||
|
||
name: build-for-release | ||
|
||
# Controls when the workflow will run | ||
on: | ||
# Allows you to run this workflow manually from the Actions tab | ||
workflow_dispatch: | ||
branches: | ||
|
||
env: | ||
FILENAME_PREFIX: OpenLog_Artemis_Geophone_Logger | ||
|
||
jobs: | ||
build: | ||
|
||
name: Build | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@master | ||
|
||
- name: Extract branch name | ||
run: echo "BRANCH=${{github.ref_name}}" >> $GITHUB_ENV | ||
|
||
- name: Get firmware version 1 | ||
run: | | ||
echo "firmwareMajor=$(grep -Po "(?<=FIRMWARE_VERSION_MAJOR = )([0-9])*(?=;$)" ./Firmware/${{ env.FILENAME_PREFIX }}/${{ env.FILENAME_PREFIX }}.ino)" >> "$GITHUB_ENV" | ||
echo "firmwareMinor=$(grep -Po "(?<=FIRMWARE_VERSION_MINOR = )([0-9])*(?=;$)" ./Firmware/${{ env.FILENAME_PREFIX }}/${{ env.FILENAME_PREFIX }}.ino)" >> "$GITHUB_ENV" | ||
- name: Get firmware version 2 | ||
run: | | ||
echo "firmwareMajorMinor=-V10-v${{ env.firmwareMajor }}${{ env.firmwareMinor }}" >> "$GITHUB_ENV" | ||
echo "firmwareMajorMinorX04=-X04-v${{ env.firmwareMajor }}${{ env.firmwareMinor }}" >> "$GITHUB_ENV" | ||
- name: Setup Arduino CLI | ||
uses: arduino/setup-arduino-cli@v1 | ||
|
||
- name: Start config file | ||
run: arduino-cli config init --additional-urls "https://raw.githubusercontent.com/sparkfun/Arduino_Apollo3/main/package_sparkfun_apollo3_index.json" | ||
|
||
- name: Update index | ||
run: arduino-cli core update-index | ||
|
||
- name: Install platform | ||
run: arduino-cli core install "Sparkfun:apollo3@2.2.1" | ||
|
||
- name: Get Known Libraries | ||
run: arduino-cli lib install | ||
"SdFat@2.2.2" | ||
"SparkFun u-blox GNSS Arduino Library" | ||
"SparkFun ADS122C04 ADC Arduino Library" | ||
"SparkFun ADS1015 Arduino Library" | ||
"SparkFun ADS1219 Arduino Library" | ||
"SparkFun Toolkit" | ||
|
||
- name: Enable external libs | ||
run: arduino-cli config set library.enable_unsafe_install true | ||
|
||
- name: Get Libraries | ||
run: arduino-cli lib install --git-url | ||
https://github.com/bluerobotics/BlueRobotics_MS5837_Library.git | ||
|
||
- name: Patch Apollo3 Core | ||
run: | | ||
cd ./Extras | ||
unzip UartPower3.zip | ||
cp HardwareSerial.h /home/runner/.arduino15/packages/SparkFun/hardware/apollo3/2.2.1/cores/arduino/mbed-bridge/core-extend/HardwareSerial.h | ||
cp HardwareSerial.cpp /home/runner/.arduino15/packages/SparkFun/hardware/apollo3/2.2.1/cores/arduino/mbed-bridge/core-implement/HardwareSerial.cpp | ||
cp UnbufferedSerial.h /home/runner/.arduino15/packages/SparkFun/hardware/apollo3/2.2.1/cores/mbed-os/drivers/UnbufferedSerial.h | ||
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 | ||
cp libmbed-os.a /home/runner/.arduino15/packages/SparkFun/hardware/apollo3/2.2.1/variants/SFE_ARTEMIS_ATP/mbed/libmbed-os.a | ||
cp SPI.cpp /home/runner/.arduino15/packages/SparkFun/hardware/apollo3/2.2.1/libraries/SPI/src/SPI.cpp | ||
rm *.h | ||
rm *.cpp | ||
rm *.a | ||
rm *.c | ||
rm *.odt | ||
- name: Compile Sketch | ||
run: arduino-cli compile -v -e -b SparkFun:apollo3:sfe_artemis_atp ./Firmware/${{ env.FILENAME_PREFIX }}/${{ env.FILENAME_PREFIX }}.ino | ||
|
||
- name: Rename binary | ||
run: | | ||
cd ./Firmware/${{ env.FILENAME_PREFIX }}/build/SparkFun.apollo3.sfe_artemis_atp/ | ||
mv ${{ env.FILENAME_PREFIX }}.ino.bin ${{ env.FILENAME_PREFIX }}${{ env.firmwareMajorMinor }}.bin | ||
echo "targetBinary=./Firmware/${{ env.FILENAME_PREFIX }}/build/SparkFun.apollo3.sfe_artemis_atp/${{ env.FILENAME_PREFIX }}${{ env.firmwareMajorMinor }}.bin" >> "$GITHUB_ENV" | ||
rm *.axf | ||
rm *.hex | ||
rm *.map | ||
- name: Move binary | ||
run: mv ${{ env.targetBinary }} ./Binaries | ||
|
||
- name: Enable Power Loss Protection | ||
run: sed -i 's|//#define noPowerLossProtection|#define noPowerLossProtection|g' ./Firmware/${{ env.FILENAME_PREFIX }}/${{ env.FILENAME_PREFIX }}.ino | ||
|
||
- name: Compile Sketch | ||
run: arduino-cli compile -v -e -b SparkFun:apollo3:sfe_artemis_atp ./Firmware/${{ env.FILENAME_PREFIX }}/${{ env.FILENAME_PREFIX }}.ino | ||
|
||
- name: Rename binary | ||
run: | | ||
cd ./Firmware/${{ env.FILENAME_PREFIX }}/build/SparkFun.apollo3.sfe_artemis_atp/ | ||
mv ${{ env.FILENAME_PREFIX }}.ino.bin ${{ env.FILENAME_PREFIX }}${{ env.firmwareMajorMinor }}-NoPowerLossProtection.bin | ||
echo "targetBinary=./Firmware/${{ env.FILENAME_PREFIX }}/build/SparkFun.apollo3.sfe_artemis_atp/${{ env.FILENAME_PREFIX }}${{ env.firmwareMajorMinor }}-NoPowerLossProtection.bin" >> "$GITHUB_ENV" | ||
rm *.axf | ||
rm *.hex | ||
rm *.map | ||
- name: Move binary | ||
run: mv ${{ env.targetBinary }} ./Binaries | ||
|
||
- name: Disable Power Loss Protection | ||
run: sed -i 's|#define noPowerLossProtection|//#define noPowerLossProtection|g' ./Firmware/${{ env.FILENAME_PREFIX }}/${{ env.FILENAME_PREFIX }}.ino | ||
|
||
- name: X04 Hardware | ||
run: | | ||
sed -i 's|#define HARDWARE_VERSION_MAJOR 1|#define HARDWARE_VERSION_MAJOR 0|g' ./Firmware/${{ env.FILENAME_PREFIX }}/${{ env.FILENAME_PREFIX }}.ino | ||
sed -i 's|#define HARDWARE_VERSION_MINOR 0|#define HARDWARE_VERSION_MINOR 4|g' ./Firmware/${{ env.FILENAME_PREFIX }}/${{ env.FILENAME_PREFIX }}.ino | ||
- name: Compile Sketch | ||
run: arduino-cli compile -v -e -b SparkFun:apollo3:sfe_artemis_atp ./Firmware/${{ env.FILENAME_PREFIX }}/${{ env.FILENAME_PREFIX }}.ino | ||
|
||
- name: Rename binary | ||
run: | | ||
cd ./Firmware/${{ env.FILENAME_PREFIX }}/build/SparkFun.apollo3.sfe_artemis_atp/ | ||
mv ${{ env.FILENAME_PREFIX }}.ino.bin ${{ env.FILENAME_PREFIX }}${{ env.firmwareMajorMinorX04 }}.bin | ||
echo "targetBinary=./Firmware/${{ env.FILENAME_PREFIX }}/build/SparkFun.apollo3.sfe_artemis_atp/${{ env.FILENAME_PREFIX }}${{ env.firmwareMajorMinorX04 }}.bin" >> "$GITHUB_ENV" | ||
rm *.axf | ||
rm *.hex | ||
rm *.map | ||
- name: Move binary | ||
run: mv ${{ env.targetBinary }} ./Binaries | ||
|
||
- name: V01 Hardware | ||
run: | | ||
sed -i 's|#define HARDWARE_VERSION_MAJOR 0|#define HARDWARE_VERSION_MAJOR 1|g' ./Firmware/${{ env.FILENAME_PREFIX }}/${{ env.FILENAME_PREFIX }}.ino | ||
sed -i 's|#define HARDWARE_VERSION_MINOR 4|#define HARDWARE_VERSION_MINOR 0|g' ./Firmware/${{ env.FILENAME_PREFIX }}/${{ env.FILENAME_PREFIX }}.ino | ||
- uses: actions-js/push@master | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
branch: ${{ env.BRANCH }} | ||
directory: './Binaries' | ||
message: 'Pushing new firmware binary' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
# Workflow that builds the firmware, but doesn't add to a release. | ||
|
||
name: non-release-build | ||
|
||
# Controls when the workflow will run | ||
on: | ||
# Allows you to run this workflow manually from the Actions tab | ||
workflow_dispatch: | ||
branches: | ||
|
||
env: | ||
FILENAME_PREFIX: OpenLog_Artemis_Geophone_Logger | ||
|
||
jobs: | ||
build: | ||
|
||
name: Build | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@master | ||
|
||
- name: Get firmware version 1 | ||
run: | | ||
echo "firmwareMajor=$(grep -Po "(?<=FIRMWARE_VERSION_MAJOR = )([0-9])*(?=;$)" ./Firmware/${{ env.FILENAME_PREFIX }}/${{ env.FILENAME_PREFIX }}.ino)" >> "$GITHUB_ENV" | ||
echo "firmwareMinor=$(grep -Po "(?<=FIRMWARE_VERSION_MINOR = )([0-9])*(?=;$)" ./Firmware/${{ env.FILENAME_PREFIX }}/${{ env.FILENAME_PREFIX }}.ino)" >> "$GITHUB_ENV" | ||
- name: Get firmware version 2 | ||
run: echo "firmwareMajorMinor=-V10-v${{ env.firmwareMajor }}${{ env.firmwareMinor }}" >> "$GITHUB_ENV" | ||
|
||
- name: Setup Arduino CLI | ||
uses: arduino/setup-arduino-cli@v1 | ||
|
||
- name: Start config file | ||
run: arduino-cli config init --additional-urls "https://raw.githubusercontent.com/sparkfun/Arduino_Apollo3/main/package_sparkfun_apollo3_index.json" | ||
|
||
- name: Update index | ||
run: arduino-cli core update-index | ||
|
||
- name: Install platform | ||
run: arduino-cli core install "Sparkfun:apollo3@2.2.1" | ||
|
||
- name: Get Known Libraries | ||
run: arduino-cli lib install | ||
"SdFat@2.2.2" | ||
"SparkFun u-blox GNSS Arduino Library" | ||
"SparkFun ADS122C04 ADC Arduino Library" | ||
"SparkFun ADS1015 Arduino Library" | ||
"SparkFun ADS1219 Arduino Library" | ||
"SparkFun Toolkit" | ||
|
||
- name: Enable external libs | ||
run: arduino-cli config set library.enable_unsafe_install true | ||
|
||
- name: Get Libraries | ||
run: arduino-cli lib install --git-url | ||
https://github.com/bluerobotics/BlueRobotics_MS5837_Library.git | ||
|
||
- name: Patch Apollo3 Core | ||
run: | | ||
cd ./Extras | ||
unzip UartPower3.zip | ||
cp HardwareSerial.h /home/runner/.arduino15/packages/SparkFun/hardware/apollo3/2.2.1/cores/arduino/mbed-bridge/core-extend/HardwareSerial.h | ||
cp HardwareSerial.cpp /home/runner/.arduino15/packages/SparkFun/hardware/apollo3/2.2.1/cores/arduino/mbed-bridge/core-implement/HardwareSerial.cpp | ||
cp UnbufferedSerial.h /home/runner/.arduino15/packages/SparkFun/hardware/apollo3/2.2.1/cores/mbed-os/drivers/UnbufferedSerial.h | ||
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 | ||
cp libmbed-os.a /home/runner/.arduino15/packages/SparkFun/hardware/apollo3/2.2.1/variants/SFE_ARTEMIS_ATP/mbed/libmbed-os.a | ||
cp SPI.cpp /home/runner/.arduino15/packages/SparkFun/hardware/apollo3/2.2.1/libraries/SPI/src/SPI.cpp | ||
- name: Compile Sketch | ||
run: arduino-cli compile -v -e -b SparkFun:apollo3:sfe_artemis_atp ./Firmware/${{ env.FILENAME_PREFIX }}/${{ env.FILENAME_PREFIX }}.ino | ||
|
||
- name: Rename binary | ||
run: | | ||
cd ./Firmware/${{ env.FILENAME_PREFIX }}/build/SparkFun.apollo3.sfe_artemis_atp/ | ||
mv ${{ env.FILENAME_PREFIX }}.ino.bin ${{ env.FILENAME_PREFIX }}${{ env.firmwareMajorMinor }}.bin | ||
echo "targetBinary=./Firmware/${{ env.FILENAME_PREFIX }}/build/SparkFun.apollo3.sfe_artemis_atp/${{ env.FILENAME_PREFIX }}${{ env.firmwareMajorMinor }}.bin" >> "$GITHUB_ENV" | ||
- name: Upload binary to action | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: ${{ env.FILENAME_PREFIX }}${{ env.firmwareMajorMinor }}.bin | ||
path: ${{ env.targetBinary }} |