first commit
This commit is contained in:
parent
9eb5992232
commit
932abc776c
|
|
@ -0,0 +1,61 @@
|
|||
name: Build and Release ESP32 Firmware
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ "main", "master" ]
|
||||
tags:
|
||||
- "v*.*.*" # v1.0.0 や v0.1.0 などのタグが Push された時にトリガー
|
||||
pull_request:
|
||||
branches: [ "main", "master" ]
|
||||
workflow_dispatch:
|
||||
|
||||
# Release 作成権限を付与
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
# arduino-cli と ESP32 コアのセットアップ
|
||||
- name: Setup Arduino CLI
|
||||
uses: esp-cpp/setup-arduino-cli@v1
|
||||
with:
|
||||
index-url: https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json
|
||||
platforms: esp32:esp32@2.0.14
|
||||
|
||||
# 依存ライブラリのインストール
|
||||
- name: Install ESP32-A2DP library
|
||||
run: arduino-cli lib install "ESP32-A2DP"
|
||||
|
||||
# コンパイル実行
|
||||
- name: Compile Sketch
|
||||
run: |
|
||||
arduino-cli compile \
|
||||
--fqbn esp32:esp32:esp32 \
|
||||
--build-property "build.partitions=huge_app" \
|
||||
--build-property "upload.maximum_size=3145728" \
|
||||
firmware/firmware.ino
|
||||
|
||||
# 通常の Artifacts 保存 (毎回実行)
|
||||
- name: Upload Build Artifacts
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: esp32-a2dp-firmware
|
||||
path: |
|
||||
firmware/build/esp32.esp32.esp32/*.bin
|
||||
|
||||
# GitHub Release の自動作成 & アセット添付 (タグ Push 時のみ実行)
|
||||
- name: Create GitHub Release
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
uses: softprops/action-gh-release@v2
|
||||
with:
|
||||
files: |
|
||||
firmware/build/esp32.esp32.esp32/firmware.ino.bin
|
||||
firmware/build/esp32.esp32.esp32/firmware.ino.bootloader.bin
|
||||
firmware/build/esp32.esp32.esp32/firmware.ino.partitions.bin
|
||||
generate_release_notes: true
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
#include "BluetoothA2DPSink.h"
|
||||
|
||||
BluetoothA2DPSink a2dp_sink;
|
||||
|
||||
void setup() {
|
||||
// I2S ピンアサインの設定 (必要に応じてご自身の基板に合わせて変更)
|
||||
i2s_pin_config_t my_pin_config = {
|
||||
.bck_io_num = 27,
|
||||
.ws_io_num = 25,
|
||||
.data_out_num = 26,
|
||||
.data_in_num = I2S_PIN_NO_CHANGE
|
||||
};
|
||||
a2dp_sink.set_pin_config(my_pin_config);
|
||||
a2dp_sink.start("MyESP32Speaker");
|
||||
}
|
||||
|
||||
void loop() {
|
||||
}
|
||||
Loading…
Reference in New Issue