mirror of
https://github.com/torlando-tech/pyxis.git
synced 2026-10-23 06:12:25 +00:00
CI: auto-build and deploy firmware to GitHub Pages on every push to main
Rewrite release-firmware.yml to build the tdeck (NimBLE) env on pushes to main (versioned as dev-<sha>) and on v* tags. Remove checked-in firmware binaries from git tracking — CI now generates and deploys them to Pages. Release creation is conditional on v* tags only. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
6744eb136d
commit
ea586112e3
6 files changed
+27
-29
No files matched your search
@@ -1,14 +1,11 @@
|
||||
name: Build and Release Firmware
|
||||
name: Build and Deploy Firmware
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
tags:
|
||||
- 'v*'
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
version:
|
||||
description: 'Version tag (e.g., v1.0.0)'
|
||||
required: true
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
@@ -16,7 +13,7 @@ permissions:
|
||||
id-token: write
|
||||
|
||||
jobs:
|
||||
build:
|
||||
build-and-deploy:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
@@ -30,39 +27,38 @@ jobs:
|
||||
with:
|
||||
python-version: '3.11'
|
||||
|
||||
- name: Install PlatformIO and esptool
|
||||
run: |
|
||||
pip install platformio esptool
|
||||
- name: Install PlatformIO
|
||||
run: pip install platformio
|
||||
|
||||
- name: Build T-Deck firmware
|
||||
run: pio run -e tdeck-bluedroid
|
||||
- name: Build T-Deck firmware (NimBLE)
|
||||
run: pio run -e tdeck
|
||||
|
||||
- name: Determine version string
|
||||
id: version
|
||||
run: |
|
||||
if [[ "$GITHUB_REF" == refs/tags/v* ]]; then
|
||||
echo "VERSION=${GITHUB_REF#refs/tags/}" >> "$GITHUB_OUTPUT"
|
||||
else
|
||||
echo "VERSION=dev-${GITHUB_SHA::7}" >> "$GITHUB_OUTPUT"
|
||||
fi
|
||||
|
||||
- name: Copy firmware binaries
|
||||
run: |
|
||||
mkdir -p docs/flasher/firmware
|
||||
cp .pio/build/tdeck-bluedroid/bootloader.bin docs/flasher/firmware/
|
||||
cp .pio/build/tdeck-bluedroid/partitions.bin docs/flasher/firmware/
|
||||
cp .pio/build/tdeck-bluedroid/firmware.bin docs/flasher/firmware/
|
||||
cp .pio/build/tdeck/bootloader.bin docs/flasher/firmware/
|
||||
cp .pio/build/tdeck/partitions.bin docs/flasher/firmware/
|
||||
cp .pio/build/tdeck/firmware.bin docs/flasher/firmware/
|
||||
BOOT_APP0=$(find ~/.platformio -name "boot_app0.bin" | head -1)
|
||||
cp "$BOOT_APP0" docs/flasher/firmware/
|
||||
|
||||
- name: Get version
|
||||
id: version
|
||||
- name: Generate manifest files
|
||||
run: |
|
||||
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
|
||||
echo "VERSION=${{ github.event.inputs.version }}" >> $GITHUB_OUTPUT
|
||||
else
|
||||
echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
|
||||
- name: Update manifest files with version
|
||||
run: |
|
||||
VERSION=${{ steps.version.outputs.VERSION }}
|
||||
# Full install manifest
|
||||
VERSION="${{ steps.version.outputs.VERSION }}"
|
||||
cat > docs/flasher/manifest-install.json << EOF
|
||||
{
|
||||
"name": "Pyxis T-Deck",
|
||||
"version": "${VERSION}",
|
||||
"new_install_prompt_erase": false,
|
||||
"builds": [
|
||||
{
|
||||
"chipFamily": "ESP32-S3",
|
||||
@@ -76,11 +72,11 @@ jobs:
|
||||
]
|
||||
}
|
||||
EOF
|
||||
# Update-only manifest
|
||||
cat > docs/flasher/manifest-update.json << EOF
|
||||
{
|
||||
"name": "Pyxis T-Deck",
|
||||
"version": "${VERSION}",
|
||||
"new_install_prompt_erase": false,
|
||||
"builds": [
|
||||
{
|
||||
"chipFamily": "ESP32-S3",
|
||||
@@ -100,11 +96,12 @@ jobs:
|
||||
destination_dir: flasher
|
||||
|
||||
- name: Create GitHub Release
|
||||
if: startsWith(github.ref, 'refs/tags/v')
|
||||
uses: softprops/action-gh-release@v2
|
||||
with:
|
||||
tag_name: ${{ steps.version.outputs.VERSION }}
|
||||
name: ${{ steps.version.outputs.VERSION }}
|
||||
files: |
|
||||
docs/flasher/firmware/firmware.bin
|
||||
generate_release_notes: true
|
||||
name: ${{ steps.version.outputs.VERSION }}
|
||||
draft: true
|
||||
Reference in new issue
Block a user