Build GNSSPeriph #120
Workflow file for this run
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
name: Build GNSSPeriph | |
on: [push, pull_request, workflow_dispatch] | |
jobs: | |
build: | |
runs-on: ubuntu-20.04 | |
container: ardupilot/ardupilot-dev-chibios:latest | |
env: | |
HERE3_CUBEID_TAG: v1.4 | |
HERE4_CUBEID_TAG: v1.4 | |
steps: | |
- name: Install dependencies | |
run: | | |
sudo apt update | |
type -p curl >/dev/null || sudo apt install curl -y | |
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg | |
sudo chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg | |
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null | |
sudo apt update | |
sudo apt install gh jq -y | |
pip install intelhex | |
- uses: actions/checkout@v2 | |
with: | |
submodules: recursive | |
- name: Download CubeID firmware for Here3+ | |
run: | | |
export HERE3_ASSET_ID=$(gh api \ | |
-H "Accept: application/vnd.github.v3.raw" \ | |
-H "Authorization: token ${{ secrets.ACCESS_TOKEN }}" \ | |
"repos/cubepilot/cubeid/releases" | jq -r '.[] | select(.tag_name==env.HERE3_CUBEID_TAG) | .assets[] | select(.name=="serial_fw_update.bin") | .id') | |
echo "HERE3_ASSET_ID=$HERE3_ASSET_ID" | |
gh api \ | |
-H "Accept: application/octet-stream" \ | |
-H "Authorization: token ${{ secrets.ACCESS_TOKEN }}" \ | |
"repos/cubepilot/cubeid/releases/assets/$HERE3_ASSET_ID" > fw_update.bin | |
ls -al fw_update.bin | |
mkdir -p ROMFS_custom/ | |
mv fw_update.bin ROMFS_custom/CubeID_fw.bin | |
env: | |
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }} | |
- name: Prepare ccache timestamp | |
id: ccache_cache_timestamp | |
run: | | |
NOW=$(date -u +"%F-%T") | |
echo "::set-output name=timestamp::${NOW}" | |
- name: ccache cache files | |
uses: actions/cache@v2 | |
with: | |
path: ~/.ccache | |
key: ${{github.workflow}}-ccache-${{steps.ccache_cache_timestamp.outputs.timestamp}} | |
restore-keys: ${{github.workflow}}-ccache- # restore ccache from either previous build on this branch or on master | |
- name: setup ccache | |
run: | | |
. .github/workflows/ccache.env | |
- name: configure | |
run: ./waf configure --board Here3+ | |
- name: build | |
run: ./waf AP_Periph | |
- name: configure bootloader | |
run: ./waf configure --board Here3+ --bootloader | |
- name: build | |
run: ./waf bootloader | |
continue-on-error: true | |
- name: copy Here3+ files to release | |
run: | | |
mkdir -p release/ | |
cp build/Here3+/bin/AP_Periph.bin release/Here3Plus_FW.bin | |
cp build/Here3+/bin/AP_Periph_with_bl.hex release/Here3Plus_FW_with_bl.hex | |
- name: Download CubeID firmware for Here4 | |
run: | | |
export HERE4_ASSET_ID=$(gh api \ | |
-H "Accept: application/vnd.github.v3.raw" \ | |
-H "Authorization: token ${{ secrets.ACCESS_TOKEN }}" \ | |
"repos/cubepilot/cubeid/releases" | jq -r '.[] | select(.tag_name==env.HERE4_CUBEID_TAG) | .assets[] | select(.name=="fem_fw_update.bin") | .id') | |
echo "HERE4_ASSET_ID=$HERE4_ASSET_ID" | |
gh api \ | |
-H "Accept: application/octet-stream" \ | |
-H "Authorization: token ${{ secrets.ACCESS_TOKEN }}" \ | |
"repos/cubepilot/cubeid/releases/assets/$HERE4_ASSET_ID" > fw_update.bin | |
ls -al fw_update.bin | |
mkdir -p ROMFS_custom/ | |
mv fw_update.bin ROMFS_custom/CubeID_fw.bin | |
env: | |
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }} | |
- name: configure | |
run: ./waf configure --board Here4 | |
- name: build | |
run: ./waf AP_Periph | |
- name: configure bootloader | |
run: ./waf configure --board Here4 --bootloader | |
- name: build | |
run: ./waf bootloader | |
continue-on-error: true | |
- name: copy Here4 files to release | |
run: | | |
cp build/Here4/bin/AP_Periph.bin release/Here4_FW.bin | |
cp build/Here4/bin/AP_Periph_with_bl.hex release/Here4_FW_with_bl.hex | |
- name: Upload Build Artifacts | |
uses: actions/[email protected] | |
with: | |
# Artifact name | |
name: GNSSPeriph | |
# A file, directory or wildcard pattern that describes what to upload | |
path: release/ | |
- name: Release | |
uses: softprops/action-gh-release@v1 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
files: | | |
release/Here3Plus_FW.bin | |
release/Here3Plus_FW_with_bl.hex | |
release/Here4_FW.bin | |
release/Here4_FW_with_bl.hex | |