Compare commits
6 Commits
esp-idf
...
8b14844ed1
| Author | SHA1 | Date | |
|---|---|---|---|
| 8b14844ed1 | |||
| 7e739369ef | |||
| 8550857711 | |||
| 6b7496d643 | |||
| 5308785d44 | |||
| 4b8c40a107 |
@@ -0,0 +1,105 @@
|
|||||||
|
name: Build and Package Arduino Firmware
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags:
|
||||||
|
- 'v*'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
steps:
|
||||||
|
- name: Checkout Repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Configure Safe Directory
|
||||||
|
run: |
|
||||||
|
git config --global --add safe.directory "*"
|
||||||
|
|
||||||
|
- name: Set Version Identifier
|
||||||
|
run: |
|
||||||
|
TAG=${GITHUB_REF#refs/tags/}
|
||||||
|
echo "$TAG" > version.txt
|
||||||
|
echo "Build version (tag): $TAG"
|
||||||
|
|
||||||
|
- name: Compile Arduino Sketch
|
||||||
|
uses: arduino/compile-sketches@v1
|
||||||
|
with:
|
||||||
|
fqbn: esp32:esp32:esp32
|
||||||
|
platforms: |
|
||||||
|
- name: esp32:esp32
|
||||||
|
source-url: https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json
|
||||||
|
sketch-paths: |
|
||||||
|
.
|
||||||
|
cli-compile-flags: |
|
||||||
|
- --export-binaries
|
||||||
|
|
||||||
|
- name: Stage Firmware Binaries
|
||||||
|
run: |
|
||||||
|
mkdir -p dist
|
||||||
|
# The action exports the compiled .bin file into the build directory
|
||||||
|
find build -name "*.bin" -exec cp {} dist/ \;
|
||||||
|
|
||||||
|
- name: Create Flashing Instructions Document
|
||||||
|
run: |
|
||||||
|
cat << 'EOF' > dist/README_FLASHING.txt
|
||||||
|
ESP32 ALDL Bridge Arduino Firmware Flash Instructions
|
||||||
|
===================================================
|
||||||
|
|
||||||
|
You can flash the compiled .bin file using esptool.py or any generic ESP32 flashing tool.
|
||||||
|
EOF
|
||||||
|
|
||||||
|
- name: Package Release
|
||||||
|
run: |
|
||||||
|
TAG=${GITHUB_REF#refs/tags/}
|
||||||
|
tar -czvf "esp32-aldl-${TAG}.tar.gz" -C dist .
|
||||||
|
|
||||||
|
- name: Upload Firmware Package
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: esp32-aldl-arduino-firmware-${{ github.sha }}
|
||||||
|
path: esp32-aldl-*.tar.gz
|
||||||
|
if-no-files-found: error
|
||||||
|
|
||||||
|
- name: Create Release and Upload Asset
|
||||||
|
env:
|
||||||
|
TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
API_URL: ${{ github.api_url }}
|
||||||
|
REPO: ${{ github.repository }}
|
||||||
|
run: |
|
||||||
|
TAG=${GITHUB_REF#refs/tags/}
|
||||||
|
FILE="esp32-aldl-${TAG}.tar.gz"
|
||||||
|
NAME="${TAG}"
|
||||||
|
|
||||||
|
# 1. Create the release
|
||||||
|
RESP=$(curl -s -H "Authorization: token $TOKEN" \
|
||||||
|
-H "Content-Type: application/json" \
|
||||||
|
-d "{\"tag_name\":\"$TAG\",\"name\":\"$NAME\",\"body\":\"Release $TAG\"}" \
|
||||||
|
"$API_URL/repos/$REPO/releases")
|
||||||
|
|
||||||
|
# 2. Extract upload endpoint
|
||||||
|
UPLOAD_URL=$(echo "$RESP" | jq -r '.upload_url // empty')
|
||||||
|
RELEASE_ID=$(echo "$RESP" | jq -r '.id // empty')
|
||||||
|
|
||||||
|
# 3. Upload asset
|
||||||
|
if [ -n "$UPLOAD_URL" ]; then
|
||||||
|
# GitHub style (upload_url contains {?name,label})
|
||||||
|
UPLOAD_URL="${UPLOAD_URL%\{?name,label\}}"
|
||||||
|
curl -s -H "Authorization: token $TOKEN" \
|
||||||
|
-H "Content-Type: application/gzip" \
|
||||||
|
--data-binary @$FILE \
|
||||||
|
"${UPLOAD_URL}?name=${FILE}"
|
||||||
|
elif [ -n "$RELEASE_ID" ]; then
|
||||||
|
# Gitea style (POST to /releases/{id}/assets)
|
||||||
|
curl -s -H "Authorization: token $TOKEN" \
|
||||||
|
-H "Content-Type: application/gzip" \
|
||||||
|
--data-binary @$FILE \
|
||||||
|
"$API_URL/repos/$REPO/releases/$RELEASE_ID/assets?name=${FILE}"
|
||||||
|
else
|
||||||
|
echo "Failed to create release"
|
||||||
|
echo "$RESP"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
build/
|
||||||
|
sdkconfig
|
||||||
Vendored
+1
@@ -0,0 +1 @@
|
|||||||
|
{}
|
||||||
+21
@@ -0,0 +1,21 @@
|
|||||||
|
MIT License
|
||||||
|
|
||||||
|
Copyright Gordon Bolton (c) 2026
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
||||||
Reference in New Issue
Block a user