arduino_esp32_a2dp/.github/workflows/build.yml

80 lines
2.7 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

name: Build and Release ESP32 Firmware
on:
push:
branches: [ "main", "master" ]
tags:
- "v*.*.*"
pull_request:
branches: [ "main", "master" ]
workflow_dispatch:
permissions:
contents: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
# 公式のアクションで arduino-cli をセットアップ
- name: Setup Arduino CLI
uses: arduino/setup-arduino-cli@v2
# ESP32 パッケージインデックスの更新と 2.0.14 のインストール
- name: Install ESP32 Board Core (2.0.14)
run: |
arduino-cli config init --overwrite
arduino-cli config set 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@2.0.14
# スケッチが使用する外部ライブラリを導入
- name: Install ESP32-A2DP library from GitHub
run: |
mkdir -p ~/Arduino/libraries
git clone https://github.com/pschatzmann/ESP32-A2DP.git ~/Arduino/libraries/ESP32-A2DP
- name: Install U8g2 library
run: arduino-cli lib install "U8g2"
# コンパイル実行 (output-dir を指定して構成ファイルを確実に生成)
- name: Compile Sketch
run: |
arduino-cli compile \
--fqbn "esp32:esp32:esp32:PartitionScheme=huge_app,FlashMode=dio,FlashFreq=80m,FlashSize=4M" \
--build-path build_temp \
--output-dir build \
firmware/firmware.ino
# ビルド生成物をシンプルな名前にリネーム(3種類のバイナリを全て整理)
- name: Normalize artifact filenames
run: |
if [ -f build/firmware.ino.bootloader.bin ]; then
mv build/firmware.ino.bootloader.bin build/bootloader.bin
fi
if [ -f build/firmware.ino.partitions.bin ]; then
mv build/firmware.ino.partitions.bin build/partitions.bin
fi
if [ -f build/firmware.ino.bin ]; then
mv build/firmware.ino.bin build/firmware.bin
fi
# 通常の Artifacts 保存 (bootloader.bin, partitions.bin, firmware.bin が含まれる)
- name: Upload Build Artifacts
uses: actions/upload-artifact@v4
with:
name: esp32-a2dp-firmware
path: |
build/*.bin
# GitHub Release の自動作成 & アセット添付 (タグ Push 時のみ)
- name: Create GitHub Release
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v2
with:
files: build/*.bin
generate_release_notes: true