Skip to content

build.yml: Delete action to upload to ExpressLRS S3 #44

build.yml: Delete action to upload to ExpressLRS S3

build.yml: Delete action to upload to ExpressLRS S3 #44

Workflow file for this run

name: Build ExpressLRS
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Inject slug/short variables
uses: rlespinasse/github-slug-action@v4
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Cache pip
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ matrix.target }}
- name: Install PlatformIO
run: |
python -m pip install --upgrade pip
pip install platformio
pip install wheel
- name: Cache PlatformIO
uses: actions/cache@v4
with:
path: ~/.platformio
key: ${{ runner.os }}-platformio
- name: Run PlatformIO Tests
run: |
cd src
platformio pkg install --platform native
platformio pkg update
PLATFORMIO_BUILD_FLAGS="-DRegulatory_Domain_ISM_2400" pio test -e native
targets:
runs-on: ubuntu-latest
outputs:
targets: ${{ steps.set-targets.outputs.targets }}
steps:
- name: Checkout
uses: actions/checkout@v4
- id: set-targets
run: echo "targets=[$( (grep '\[env:.*UART\]' src/targets/unified.ini ; grep -r '\[env:.*STLINK\]' src/targets/) | sed 's/.*://' | sed s/.$// | egrep "(STLINK|UART)" | grep -v DEPRECATED | tr '\n' ',' | sed 's/,$/"\n/' | sed 's/,/","/'g | sed 's/^/"/')]" >> $GITHUB_OUTPUT
build:
needs: targets
strategy:
fail-fast: false
matrix:
target: ${{fromJSON(needs.targets.outputs.targets)}}
runs-on: ubuntu-latest
steps:
- name: Inject slug/short variables
uses: rlespinasse/github-slug-action@v4
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Cache pip
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ matrix.target }}
- name: Install PlatformIO
run: |
python -m pip install --upgrade pip
pip install platformio
pip install wheel
- name: Cache PlatformIO
uses: actions/cache@v4
with:
path: ~/.platformio
key: ${{ runner.os }}-platformio
- name: Run PlatformIO
run: |
mkdir -p ~/artifacts/firmware
cd src
platformio pkg install --platform native
platformio pkg update
case ${{matrix.target}} in
*2400* | FM30*)
# release builds
PLATFORMIO_BUILD_FLAGS="-DRegulatory_Domain_EU_CE_2400" pio run -e ${{ matrix.target }}
OUTDIR=~/artifacts/firmware/LBT/`echo ${{ matrix.target }} | sed s/_via.*//`
mkdir -p $OUTDIR
mv .pio/build/${{ matrix.target }}/*.{elrs,bin} $OUTDIR >& /dev/null || :
PLATFORMIO_BUILD_FLAGS="-DRegulatory_Domain_ISM_2400" pio run -e ${{ matrix.target }}
OUTDIR=~/artifacts/firmware/FCC/`echo ${{ matrix.target }} | sed s/_via.*//`
mkdir -p $OUTDIR
mv .pio/build/${{ matrix.target }}/*.{elrs,bin} $OUTDIR >& /dev/null || :
;;
*)
# release build
PLATFORMIO_BUILD_FLAGS="-DRegulatory_Domain_FCC_915" pio run -e ${{ matrix.target }}
OUTDIR=~/artifacts/firmware/FCC/`echo ${{ matrix.target }} | sed s/_via.*//`
mkdir -p $OUTDIR
mv .pio/build/${{ matrix.target }}/*.{elrs,bin} $OUTDIR >& /dev/null || :
;;
esac
- name: Store Artifacts
uses: actions/upload-artifact@v4
with:
name: temp-${{ matrix.target }}
path: ~/artifacts/**/*
retention-days: 1
continue-on-error: true
firmware:
needs: [build, test]
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Checkout targets repo
uses: actions/checkout@v4
with:
repository: ExpressLRS/targets
path: src/hardware
- name: Get firmware artifacts
uses: actions/download-artifact@v4
with:
path: dist
merge-multiple: true
- name: Copy hardware files to firmware folder
run: |
cp -r src/hardware dist/firmware
jq 'del(.generic)' src/hardware/targets.json > dist/firmware/hardware/targets.json
- name: Copy Lua to to firmware folder
run: |
mkdir -p dist/firmware/lua
cp -r src/lua/elrsV3.lua dist/firmware/lua
- name: Copy bootloader files to firmware folder
run: cd src ; find bootloader -name \*.bin -o -name \*.frk | grep -v src/ | cpio -pdm ../dist/firmware
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Build flasher "binary" with shiv
run: |
cd src/python
pip install shiv==1.0.6
shiv -c flash -o ../../dist/firmware/flasher.pyz pyserial .
- name: Update firmware artifact
uses: actions/upload-artifact@v4
with:
name: firmware
path: dist/**/*
- name: Create firmware zip bundle
run: |
cd dist
zip -r -9 ../firmware.zip ./firmware
# DELETED - name: Upload firmware bundle to ExpressLRS artifactory