Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
8cf0bec
draft workflow (.yml and .pro) edits to automate firmware compilation…
brentfpage Jan 30, 2026
d7dccb8
stop-gap hard-coding of firmware version in mac.yml
brentfpage Feb 8, 2026
5ed197b
trying to define the avr firmware version using a workflow instead of…
brentfpage Feb 16, 2026
73ac308
-needs- defined at job scope
brentfpage Feb 16, 2026
a676ad3
typo fix
brentfpage Feb 16, 2026
24f8df9
workflow file needs at least one job
brentfpage Feb 16, 2026
6e52a09
job requires runs-on
brentfpage Feb 16, 2026
9402722
job requires a step
brentfpage Feb 16, 2026
0aa47b2
also call avr_ver_def.yml in avr.yml
brentfpage Feb 16, 2026
edcc8cb
had negelected to update 0x0007 to a soft-coded value in a few places
brentfpage Feb 16, 2026
db1b848
move the avr url fetching from mac.yml to a standalone workflow
brentfpage Feb 23, 2026
f5409f6
move steps for downloading the firmware to a single composite action
brentfpage Feb 24, 2026
45bc92b
Merge branch 'master' into workflow_for_avr_build_b
brentfpage Feb 24, 2026
82d7b5d
notation change: avr->firmware
brentfpage Feb 24, 2026
c38f72f
remove continuous release compatibility for now
brentfpage Feb 24, 2026
45761f4
trying to add automatic firmware packaging in android.yml
brentfpage Feb 24, 2026
3bcbd9a
trying to add automatic firmware packaging in linux.yml
brentfpage Feb 24, 2026
560865e
add references to EXPECTED_FIRMWARE_VERSION in linux build scripts
brentfpage Feb 24, 2026
124fd39
re-separate define-firmware-ver-action so that it can be invoked by f…
brentfpage Feb 24, 2026
b6f30bb
accommodate downloading firmware using run-id from in-process continu…
brentfpage Feb 24, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .github/actions/define-firmware-ver-action/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Define the firmware version

outputs:
firmware_ver:
description: the firmware version number 0x000N
value: ${{ steps.define_firmware_ver.outputs.firmware_ver }}

runs:
using: "composite"
steps:
- name: define firmware_ver
id: define_firmware_ver
run: echo "firmware_ver=0x0007" >> $GITHUB_OUTPUT
shell: bash
63 changes: 63 additions & 0 deletions .github/actions/download-firmware-action/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Download the firmware

inputs:
FIRMWARE_VARIANT:
required: true
type: string
FIRMWARE_RUN_ID:
required: false
type: string

runs:
using: "composite"
steps:
# when the build is NOT part of a continuous release, the firware hex from the most recent continuous release will be packaged with the desktop interface
- name: Determine download url for the firmware from the most recent continuous release
if: github.event.workflow != '.github/workflows/continuous.yml'
id: run_query
run: |
HEX_URL=$(gh api graphql -f query='query {repository ( owner : "brentfpage", name: "Labrador") {release ( tagName: "continuous" ) {releaseAssets(first:10) {nodes {downloadUrl}}}}}' | jq -r '.data.repository.release.releaseAssets.nodes[] | select(.downloadUrl| test("${{ inputs.FIRMWARE_VARIANT }}.hex")) | .[]')
echo "firmware_url=${HEX_URL}" >> $GITHUB_OUTPUT
env:
GH_TOKEN: ${{ github.token }}
shell: bash

# query description: get at most 10 assets from the most recent continuous release (assume there are fewer than 10), find the one that includes FIRMWARE_VARIANT.hex in the download url
# prettified (ish) query:
# query {\
# repository ( owner : "espotek-org", name: "Labrador") {\
# release ( tagName: "continuous" ) {\
# releaseAssets(first:10) {\
# nodes {\
# downloadUrl\
# }\
# }\
# }\
# }\
# }\
# ' | jq -r '.data.repository.release.releaseAssets.nodes[] | select(.downloadUrl| test("${{ inputs.FIRMWARE_VARIANT }}.hex")) | .[]'

- name: Download firmware from most recent continuous release
if: github.event.workflow != '.github/workflows/continuous.yml'
run: |
mkdir asset-hex
wget --directory-prefix=asset-hex ${{ steps.run_query.outputs.firmware_url }}
shell: bash

# when the build is part of a continuous release, the release's firmware hex will be packaged with the desktop interface
- name: Download firmware from in-process continuous release
if: github.event.workflow == '.github/workflows/continuous.yml'
uses: actions/download-artifact@v4
with:
run-id: ${{ inputs.FIRMWARE_RUN_ID }}
github-token: ${{ secrets.GITHUB_TOKEN }}

- name: move firmware to appropriate directory
run: |
mv asset-hex/*${{ inputs.FIRMWARE_VARIANT }}.hex Desktop_Interface/resources/firmware
shell: bash





19 changes: 17 additions & 2 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ permissions:
on:
workflow_dispatch:
workflow_call:
inputs:
FIRMWARE_RUN_ID:
required: true
type: string

push:
branches:
Expand All @@ -31,6 +35,17 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

- name: Define firmware version
id: define_firmware_version
uses: ./.github/actions/define-firmware-ver-action

- name: Download firmware
id: download_firmware
uses: ./.github/actions/download-firmware-action
with:
FIRMWARE_VARIANT: '02'
FIRMWARE_RUN_ID: ${{ github.event.workflow == './github/workflows/continuous.yml' && inputs.FIRMWARE_RUN_ID || ''}} # for grabbing the firmware from an in-process continuous release

- name: Install Qt
uses: jurplel/install-qt-action@v4
with:
Expand Down Expand Up @@ -74,13 +89,13 @@ jobs:
export ANDROID_NDK_ROOT="${ANDROID_SDK_ROOT}/ndk/21.3.6528147"
APK_BASENAME="Labrador-$(git rev-parse --short HEAD)"
if [ -e cert.cer ] && [ -e cert.p8 ]; then
qmake -config release
qmake -config release EXPECTED_FIRMWARE_VERSION=${{ steps.define_firmware_version.outputs.firmware_ver }}
make -j$(nproc)
make INSTALL_ROOT=android-build install
JAVA_HOME=${JAVA_HOME_8_X64} androiddeployqt --input android-Labrador-deployment-settings.json --output android-build --aab --android-platform android-31 --verbose --gradle --release
${ANDROID_SDK_ROOT}/build-tools/31.0.0/apksigner sign --in android-build/build/outputs/apk/release/android-build-release-unsigned.apk --out ${APK_BASENAME}-release-signed.apk --key cert.p8 --cert cert.cer --verbose
else
qmake -config debug
qmake -config debug EXPECTED_FIRMWARE_VERSION=${{ steps.define_firmware_version.outputs.firmware_ver }}
make -j$(nproc)
make INSTALL_ROOT=android-build install
JAVA_HOME=${JAVA_HOME_8_X64} androiddeployqt --input android-Labrador-deployment-settings.json --output android-build --aab --android-platform android-31 --verbose --gradle
Expand Down
29 changes: 25 additions & 4 deletions .github/workflows/continuous.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,48 @@ on:
workflow_dispatch:

jobs:
build-firmware:
uses: ./.github/workflows/firmware.yml
secrets: inherit
build-android:
needs:
- build-firmware
uses: ./.github/workflows/android.yml
with:
FIRMWARE_RUN_ID: ${{ needs.build-firmware.outputs.run_id }}
secrets: inherit
build-linux:
needs:
- build-firmware
uses: ./.github/workflows/linux.yml
with:
FIRMWARE_RUN_ID: ${{ needs.build-firmware.outputs.run_id }}
secrets: inherit
build-mac:
needs:
- build-firmware
uses: ./.github/workflows/mac.yml
with:
FIRMWARE_RUN_ID: ${{ needs.build-firmware.outputs.run_id }}
secrets: inherit
build-windows:
uses: ./.github/workflows/windows.yml
secrets: inherit

# build-windows:
# needs:
# - build-firmware
# uses: ./.github/workflows/windows.yml
# with:
# FIRMWARE_RUN_ID: ${{ needs.build-firmware.outputs.run_id }}
# secrets: inherit

release:
permissions:
contents: write
needs:
- build-firmware
- build-android
- build-linux
- build-mac
- build-windows
# - build-windows
if: github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
steps:
Expand Down
62 changes: 62 additions & 0 deletions .github/workflows/firmware.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Build firmware

permissions:
contents: read
pull-requests: write

on:
workflow_call:
outputs:
run_id:
description: the run-id of the workflow run
value: ${{ jobs.build-hex.outputs.run_id }}
workflow_dispatch:
push:


jobs:
build-hex:
runs-on: ubuntu-latest
outputs:
run_id: ${{ steps.step_get_run_id.outputs.RUN_ID }}
steps:
- name : Checkout repository
uses: actions/checkout@v4

- name: Define firmware version
id: define_firmware_version
uses: ./.github/actions/define-firmware-ver-action

- name : make 01
uses: bazhenov/action-avr-make@v1.1
with:
dir: AVR_Code
target: '01'
env:
FIRMWARE_VERSION_ID: ${{ steps.define_firmware_version.outputs.firmware_ver }}

- name : make clean
uses: bazhenov/action-avr-make@v1.1
with:
dir: AVR_Code
target: clean_o_d

- name : make 02
uses: bazhenov/action-avr-make@v1.1
with:
dir: AVR_Code
target: '02'
env:
FIRMWARE_VERSION_ID: ${{ steps.define_firmware_version.outputs.firmware_ver }}

- name: Upload hex artifacts
uses: actions/upload-artifact@v4
with:
name: asset-hex
path: AVR_Code/labrafirm*.hex
compression-level: 0
if-no-files-found: error

- name: Prepare workflow run ID output
id: step_get_run_id
run: echo "RUN_ID=${{ github.run_id }}" >> "$GITHUB_OUTPUT"
40 changes: 34 additions & 6 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ permissions:
on:
workflow_dispatch:
workflow_call:
inputs:
FIRMWARE_RUN_ID:
required: true
type: string

push:
branches:
Expand Down Expand Up @@ -37,6 +41,17 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

- name: Define firmware version
id: define_firmware_version
uses: ./.github/actions/define-firmware-ver-action

- name: Download firmware
id: download_firmware
uses: ./.github/actions/download-firmware-action
with:
FIRMWARE_VARIANT: '02'
FIRMWARE_RUN_ID: ${{ github.event.workflow == './github/workflows/continuous.yml' && inputs.FIRMWARE_RUN_ID || ''}} # for grabbing the firmware from an in-process continuous release

- name: Install dependencies
run: |
sudo apt-get update
Expand All @@ -46,24 +61,25 @@ jobs:
- name: Build librador
working-directory: Librador_API/___librador/librador
run: |
qmake -config release
qmake -config release EXPECTED_FIRMWARE_VERSION=${{ steps.define_firmware_version.outputs.firmware_ver }}
make -j$(nproc)

- name: Build librademo
working-directory: Librador_API/___librador/librademo
run: |
qmake -config release
qmake -config release EXPECTED_FIRMWARE_VERSION=${{ steps.define_firmware_version.outputs.firmware_ver }}
make -j$(nproc)

- name: Build basicdemo
working-directory: Librador_API/___librador/basicdemo
run: |
qmake -config release
qmake -config release EXPECTED_FIRMWARE_VERSION=${{ steps.define_firmware_version.outputs.firmware_ver }}
make -j$(nproc)

- name: Build AppImage
working-directory: Desktop_Interface
run: |
export EXPECTED_FIRMWARE_VERSION=${{ steps.define_firmware_version.outputs.firmware_ver }}
./make_appimage

- name: Upload artifacts
Expand All @@ -88,6 +104,17 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

- name: Define firmware version
id: define_firmware_version
uses: ./.github/actions/define-firmware-ver-action

- name: Download firmware
id: download_firmware
uses: ./.github/actions/download-firmware-action
with:
FIRMWARE_VARIANT: '02'
# FIRMWARE_RUN_ID: ${{ inputs.FIRMWARE_RUN_ID }} # for grabbing the firmware from an in-process continuous release

- name: Install dependencies
run: |
sudo apt-get update
Expand All @@ -97,24 +124,25 @@ jobs:
- name: Build librador
working-directory: Librador_API/___librador/librador
run: |
qmake -config release
qmake -config release EXPECTED_FIRMWARE_VERSION=${{ steps.define_firmware_version.outputs.firmware_ver }}
make -j$(nproc)

- name: Build librademo
working-directory: Librador_API/___librador/librademo
run: |
qmake -config release
qmake -config release EXPECTED_FIRMWARE_VERSION=${{ steps.define_firmware_version.outputs.firmware_ver }}
make -j$(nproc)

- name: Build basicdemo
working-directory: Librador_API/___librador/basicdemo
run: |
qmake -config release
qmake -config release EXPECTED_FIRMWARE_VERSION=${{ steps.define_firmware_version.outputs.firmware_ver }}
make -j$(nproc)

- name: Build Debian package
working-directory: Desktop_Interface
run: |
export EXPECTED_FIRMWARE_VERSION=${{ steps.define_firmware_version.outputs.firmware_ver }}
DEB_BUILD_OPTIONS=nostrip dpkg-buildpackage -b
mv ../espotek-labrador*.deb ../Labrador-$(git rev-parse --short HEAD)-${{ matrix.arch }}.deb

Expand Down
Loading
Loading