Build GNSSPeriph #214
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: | |
release: | |
types: [created] | |
jobs: | |
build: | |
runs-on: ubuntu-20.04 | |
container: ardupilot/ardupilot-dev-chibios:latest | |
env: | |
HERE3_CUBEID_TAG: v1.10 | |
HERE4_CUBEID_TAG: v1.10 | |
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@v3 | |
with: | |
submodules: recursive | |
- run: git config --system --add safe.directory /__w/GNSSPeriph-release/GNSSPeriph-release | |
- 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 ardupilot/ROMFS_custom/ | |
mv fw_update.bin ardupilot/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+ -g | |
- name: build | |
run: ./waf clean && ./waf AP_Periph | |
- name: configure bootloader | |
run: ./waf configure --board Here3+ --bootloader | |
- name: build | |
run: ./waf bootloader | |
- 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 | |
cp build/Here3+/bin/AP_Periph release/Here3Plus_FW.elf | |
cp build/Here3+/bin/AP_Periph.apj release/Here3+_FW.apj | |
- 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 ardupilot/ROMFS_custom/ | |
mv fw_update.bin ardupilot/ROMFS_custom/CubeID_fw.bin | |
env: | |
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }} | |
- name: configure | |
run: ./waf configure --board Here4 -g | |
- name: build | |
run: ./waf clean && ./waf AP_Periph | |
- name: configure bootloader | |
run: ./waf configure --board Here4 --bootloader | |
- name: build | |
run: ./waf bootloader | |
- 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 | |
cp build/Here4/bin/AP_Periph release/Here4_FW.elf | |
cp build/Here4/bin/AP_Periph.apj release/Here4_FW.apj | |
- name: configure | |
run: ./waf configure --board HerePro -g | |
- name: build | |
run: ./waf clean && ./waf AP_Periph | |
- name: configure bootloader | |
run: ./waf configure --board HerePro --bootloader | |
- name: build | |
run: ./waf bootloader | |
- name: copy HerePro files to release | |
run: | | |
cp build/HerePro/bin/AP_Periph.bin release/HerePro_FW.bin | |
cp build/HerePro/bin/AP_Periph_with_bl.hex release/HerePro_FW_with_bl.hex | |
cp build/HerePro/bin/AP_Periph release/HerePro_FW.elf | |
cp build/HerePro/bin/AP_Periph.apj release/HerePro_FW.apj | |
- name: configure | |
run: ./waf configure --board HereProAlpha -g | |
- name: build | |
run: ./waf clean && ./waf AP_Periph | |
- name: copy HereProAlpha files to release | |
run: | | |
cp build/HereProAlpha/bin/AP_Periph.bin release/HereProAlpha_FW.bin | |
cp build/HereProAlpha/bin/AP_Periph release/HereProAlpha_FW.elf | |
cp build/HereProAlpha/bin/AP_Periph.apj release/HereProAlpha_FW.apj | |
- name: package release | |
run: | | |
cd release | |
zip -r ../GNSSPeriph.zip . | |
cd .. | |
- 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/ | |
# upload to github releases | |
- name: Upload Release Assets | |
uses: actions/upload-release-asset@latest | |
if: github.event_name == 'release' | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ github.event.release.upload_url }} | |
asset_name: GNSSPeriph.zip | |
asset_path: GNSSPeriph.zip | |
asset_content_type: application/zip |