Add firmware artifact collection and Gitea package publishing
Some checks failed
Build Matrix / Build (esp32s3, Seeed XIAO ESP32-S3 + Wio SX1262, seeed_xiao_s3_wio_sx1262) (push) Has been cancelled
CI/CD / Lint and Format Check (push) Has been cancelled
Build Matrix / Build (esp32s3, Heltec WiFi LoRa 32 V3 (ESP32-S3, SX1262), heltec_v3) (push) Has been cancelled
CI/CD / Unit Tests (push) Has been cancelled
CI/CD / Build heltec_v3 (push) Has been cancelled
CI/CD / Build seeed_xiao_s3_wio_sx1262 (push) Has been cancelled
CI/CD / Publish Packages (push) Has been cancelled
CI/CD / Build Summary (push) Has been cancelled
Some checks failed
Build Matrix / Build (esp32s3, Seeed XIAO ESP32-S3 + Wio SX1262, seeed_xiao_s3_wio_sx1262) (push) Has been cancelled
CI/CD / Lint and Format Check (push) Has been cancelled
Build Matrix / Build (esp32s3, Heltec WiFi LoRa 32 V3 (ESP32-S3, SX1262), heltec_v3) (push) Has been cancelled
CI/CD / Unit Tests (push) Has been cancelled
CI/CD / Build heltec_v3 (push) Has been cancelled
CI/CD / Build seeed_xiao_s3_wio_sx1262 (push) Has been cancelled
CI/CD / Publish Packages (push) Has been cancelled
CI/CD / Build Summary (push) Has been cancelled
- Upload firmware binaries as build artifacts (5-day retention) - Add publish-packages job to collect, rename with timestamp, and publish to Gitea - Firmware named as: board-<unix-timestamp>.bin - Publishes to Gitea generic package registry only on main branch push - Include package publishing in CI summary status check
This commit is contained in:
@@ -77,10 +77,52 @@ jobs:
|
||||
- name: Build ${{ matrix.target }}
|
||||
run: pio run -e ${{ matrix.target }}
|
||||
|
||||
- name: Upload firmware artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: firmware-${{ matrix.target }}
|
||||
path: .pio/build/${{ matrix.target }}/firmware.bin
|
||||
retention-days: 5
|
||||
|
||||
publish-packages:
|
||||
name: Publish Packages
|
||||
runs-on: ubuntu-latest
|
||||
needs: [ build ]
|
||||
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
|
||||
steps:
|
||||
- uses: actions/download-artifact@v4
|
||||
with:
|
||||
path: artifacts
|
||||
|
||||
- name: Publish firmware packages to Gitea
|
||||
run: |
|
||||
TIMESTAMP=$(date +%s)
|
||||
|
||||
# Create package directory
|
||||
mkdir -p packages
|
||||
|
||||
# Collect and rename all firmware binaries
|
||||
for dir in artifacts/firmware-*/; do
|
||||
board_name=$(basename "$dir" | sed 's/^firmware-//')
|
||||
cp "$dir/firmware.bin" "packages/${board_name}-${TIMESTAMP}.bin"
|
||||
echo "📦 Prepared: ${board_name}-${TIMESTAMP}.bin"
|
||||
done
|
||||
|
||||
# Upload each firmware to Gitea generic package registry
|
||||
for bin_file in packages/*.bin; do
|
||||
filename=$(basename "$bin_file")
|
||||
echo "⬆️ Publishing $filename..."
|
||||
|
||||
curl -X POST \
|
||||
-H "Authorization: token ${{ secrets.GITEA_TOKEN }}" \
|
||||
-F "file=@${bin_file}" \
|
||||
"${{ gitea.server_url }}/api/packages/${{ gitea.repository_owner }}/generic/firmware/${{ github.ref_name }}/${filename}"
|
||||
done
|
||||
|
||||
summary:
|
||||
name: Build Summary
|
||||
runs-on: ubuntu-latest
|
||||
needs: [ lint, test, build ]
|
||||
needs: [ lint, test, build, publish-packages ]
|
||||
if: always()
|
||||
steps:
|
||||
- name: Check status
|
||||
@@ -89,4 +131,8 @@ jobs:
|
||||
echo "❌ CI failed"
|
||||
exit 1
|
||||
fi
|
||||
if [ "${{ needs.publish-packages.result }}" != "skipped" ] && [ "${{ needs.publish-packages.result }}" = "failure" ]; then
|
||||
echo "⚠️ Build succeeded but package publishing failed"
|
||||
exit 1
|
||||
fi
|
||||
echo "✅ All checks passed"
|
||||
|
||||
Reference in New Issue
Block a user