4 Commits

Author SHA1 Message Date
gronod 6d9ea0ed82 ci: remove artifact upload step from build workflow
Build and Package Arduino Firmware / build (push) Successful in 4m17s
2026-06-14 18:17:31 +01:00
gronod c2bd58a0ed ci: replace compile-sketches action with manual Arduino CLI installation and compilation
Build and Package Arduino Firmware / build (push) Failing after 4m27s
2026-06-14 18:08:08 +01:00
gronod 8b14844ed1 chore: add VSCode Arduino helper configuration file
Build and Package Arduino Firmware / build (push) Failing after 55s
2026-06-14 15:07:50 +01:00
gronod 7e739369ef CI: Tag-only release workflow with cross-platform curl upload 2026-06-14 15:05:45 +01:00
2 changed files with 64 additions and 26 deletions
+63 -26
View File
@@ -2,18 +2,17 @@ name: Build and Package Arduino Firmware
on:
push:
branches:
- '*'
pull_request:
branches:
- '*'
tags:
- 'v*'
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout Repository
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Configure Safe Directory
run: |
@@ -21,26 +20,28 @@ jobs:
- name: Set Version Identifier
run: |
git rev-parse --short HEAD > version.txt
echo "Build version (commit ID): $(cat version.txt)"
TAG=${GITHUB_REF#refs/tags/}
echo "$TAG" > version.txt
echo "Build version (tag): $TAG"
- name: Install Arduino CLI
run: |
curl -fsSL https://raw.githubusercontent.com/arduino/arduino-cli/master/install.sh | sh
mv bin/arduino-cli /usr/local/bin/
arduino-cli config init
arduino-cli config add board_manager.additional_urls https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json
arduino-cli core update-index
arduino-cli core install esp32:esp32
- 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
run: |
mkdir -p build
arduino-cli compile --fqbn esp32:esp32:esp32 --output-dir build .
- 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/ \;
cp build/*.bin dist/
- name: Create Flashing Instructions Document
run: |
@@ -53,10 +54,46 @@ jobs:
- name: Package Release
run: |
tar -czvf esp32-aldl-arduino-firmware.tar.gz -C dist .
TAG=${GITHUB_REF#refs/tags/}
tar -czvf "esp32-aldl-${TAG}.tar.gz" -C dist .
- 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
- name: Upload Firmware Package
uses: actions/upload-artifact@v3
with:
name: esp32-aldl-arduino-firmware-${{ github.sha }}
path: esp32-aldl-arduino-firmware.tar.gz
+1
View File
@@ -0,0 +1 @@
{}