Skip to content

fix: align GT911 touches with display rotation #99

fix: align GT911 touches with display rotation

fix: align GT911 touches with display rotation #99

name: IDF Build + Web Flash Deploy
on:
push:
pull_request:
permissions:
contents: read
actions: read
pages: write
id-token: write
jobs:
build:
name: Build (ESP-IDF 5.4.2)
runs-on: ubuntu-latest
permissions:
contents: write
actions: read
pages: write
id-token: write
steps:
- name: Checkout (no LFS)
uses: actions/checkout@v4
with:
lfs: false
submodules: recursive
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Fetch external repos
run: python ./fetch_repos.py
- name: Build with ESP-IDF 5.4.2 (esp32p4)
uses: espressif/esp-idf-ci-action@v1
with:
esp_idf_version: v5.4.2
target: esp32p4
path: platforms/tab5
command: |
set -euo pipefail
if grep -R "espressif/settings_core" -n .; then
echo "Do not reference espressif/settings_core"
exit 1
fi
rm -rf managed_components
idf.py reconfigure
idf.py build
- name: Merge firmware for ESP Web Tools
shell: bash
working-directory: platforms/tab5/build
env:
SITE_DIR: ${{ github.workspace }}/platforms/tab5/site
run: |
python -m pip install --upgrade esptool
mkdir -p "$SITE_DIR"
python -m esptool --chip esp32p4 merge_bin -o "$SITE_DIR/firmware-merged.bin" "@flash_args"
# OPTIONAL: publish each build’s bin as a Release asset (so the page can list last 5)
- name: Create Release & upload merged bin (main branch only)
if: ${{ github.event_name != 'pull_request' && github.ref == 'refs/heads/main' }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} # gh prefers GH_TOKEN; GITHUB_TOKEN also works
run: |
set -euo pipefail
TAG="build-${{ github.run_number }}"
NAME="M5Tab5 build ${{ github.run_number }}"
BIN="platforms/tab5/site/firmware-merged.bin"
SHORT_SHA="${GITHUB_SHA::7}"
LABEL="m5tab5_userdemo-${{ github.run_number }}-${SHORT_SHA}.bin"
# create (idempotent)
gh release create "$TAG" -t "$NAME" -n "Automated build from $GITHUB_SHA" || true
# verify release exists before uploading
if ! gh release view "$TAG" >/dev/null 2>&1; then
echo "::error::Release $TAG was not created (check token permissions: contents: write)."
exit 1
fi
gh release upload "$TAG" "$BIN#${LABEL}" --clobber
- name: Prune old build releases (keep last 5)
if: ${{ github.event_name != 'pull_request' && github.ref == 'refs/heads/main' }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
set -euo pipefail
mapfile -t TAGS < <(gh release list --limit 100 --json tagName,createdAt \
--jq '.[] | select(.tagName|startswith("build-")) | .tagName')
# sorted newest->oldest by default; drop first 5
if [ "${#TAGS[@]}" -gt 5 ]; then
for tag in "${TAGS[@]:5}"; do gh release delete "$tag" -y; done
fi
- name: Write site files
shell: bash
working-directory: platforms/tab5/site
run: |
# Drop in the enhanced index.html from your repo (already added).
# Provide alias for /flash.html and disable Jekyll.
cp index.html flash.html
: > .nojekyll
- name: List site files (debug)
run: find platforms/tab5/site -maxdepth 1 -type f -printf "%f\n"
- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v3
with:
path: platforms/tab5/site
publish:
name: Deploy Web Flash
runs-on: ubuntu-latest
needs: build
if: ${{ github.event_name != 'pull_request' && github.ref == 'refs/heads/main' }}
permissions:
contents: read
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Configure Pages
uses: actions/configure-pages@v5
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4