Loading files
This file is pinned to the selected release. Download the original to open it in your design tool.
8c2908ee5This file is pinned to the selected release. Download the original to open it in your design tool.
name: Borneo Firmware Release CI
on:
push:
branches: [master]
paths:
- 'fw/**'
- '.github/workflows/fw-release.yml'
pull_request:
branches: [master]
paths:
- 'fw/**'
- '.github/workflows/fw-release.yml'
permissions:
contents: write
jobs:
release:
runs-on: ubuntu-latest
env:
LYFI_PRODUCTS: bst/ulva6 bst/blc06mk1 bst/xiaoc3 bst/c3devkitm1
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Build LyFi Firmware in Docker
run: |
mkdir artifacts
for product in ${{ env.LYFI_PRODUCTS }}; do
docker run -t \
-v "${GITHUB_WORKSPACE}:/app/${{ github.repository }}" \
-w "/app/${{ github.repository }}/fw/lyfi" \
espressif/idf:v5.5 \
/bin/bash -c "rm -rf build && git config --global --add safe.directory '*' && idf.py build -DPRODUCT_ID=$product -DCMAKE_BUILD_TYPE=Release && idf.py merge-bin"
python fw/scripts/ci/generate_firmware_manifest.py fw/lyfi -o artifacts
done
- name: Generate Manifests file
run: python fw/scripts/ci/merge_manifest.py ./artifacts -o ./artifacts/manifests.json
- name: Delete existing release and tag
run: |
if gh release view release-fw-latest >/dev/null 2>&1; then
gh release delete release-fw-latest --yes
fi
if git ls-remote --tags origin | grep -q "release-fw-latest"; then
git push origin --delete release-fw-latest
fi
- name: Create and push new tag
run: |
git tag release-fw-latest
git push origin release-fw-latest
- name: Create GitHub Release
uses: softprops/action-gh-release@v1
with:
tag_name: release-fw-latest
name: Borneo-IoT Latest Firmware Release
draft: false
files: artifacts/*
- name: Deploy to web-flasher repo (firmware_ce branch)
env:
DEPLOY_KEY: ${{ secrets.FW_CE_DEPLOY_KEY }}
run: |
mkdir -p ~/.ssh
echo "$DEPLOY_KEY" > ~/.ssh/id_ed25519
chmod 600 ~/.ssh/id_ed25519
ssh-keyscan github.com >> ~/.ssh/known_hosts
git config --global user.name "GitHub Actions"
git config --global user.email "actions@github.com"
git clone --depth 1 --branch firmware_ce git@github.com:borneo-iot/web-flasher.git _flasher_site || \
(git clone --depth 1 git@github.com:borneo-iot/web-flasher.git _flasher_site && cd _flasher_site && git checkout --orphan firmware_ce)
cd _flasher_site/
rm -rf ./*
cp -r ../artifacts/*.bin .
cp -r ../artifacts/manifests.json .
git add .
git commit -m "Update firmware CE $(date -u +'%Y-%m-%d %H:%M:%S')" || true
git push origin firmware_ce --force