Update build.yml #10
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: build | |
on: [push, pull_request] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
with: | |
path: ESP32-SOCKETIO | |
- name: Setup Arduino CLI | |
uses: arduino/[email protected] | |
- name: Install Python | |
uses: actions/setup-python@v1 | |
with: | |
python-version: '3.11' | |
- name: Install requirements | |
run: | | |
pip install pyserial | |
echo ${{github.ref}} | |
- name: Install platform | |
run: | | |
arduino-cli core update-index --additional-urls https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json | |
arduino-cli core install esp32:esp32 --additional-urls https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json | |
- name: Install libraries | |
run: | | |
arduino-cli lib install FastLED | |
arduino-cli lib install WebSockets | |
arduino-cli lib install ArduinoJson | |
arduino-cli lib install AceButton | |
- name: Checkout ESPAsyncWebServer | |
uses: actions/checkout@v2 | |
with: | |
repository: me-no-dev/ESPAsyncWebServer | |
path: ESPAsyncWebServer | |
- name: Checkout AsyncTCP | |
uses: actions/checkout@v2 | |
with: | |
repository: me-no-dev/AsyncTCP | |
path: AsyncTCP | |
- name: Checkout SocketIoClient | |
uses: actions/checkout@v2 | |
with: | |
repository: timum-viw/socket.io-client | |
path: SocketIoClient | |
- name: Move libs to Arduino directory | |
run: | | |
mv ESPAsyncWebServer /home/runner/Arduino/libraries/ESPAsyncWebServer | |
mv AsyncTCP /home/runner/Arduino/libraries/AsyncTCP | |
mv SocketIoClient /home/runner/Arduino/libraries/SocketIoClient | |
- name: Compile | |
run: | | |
mkdir build | |
echo "Compiling ${{github.repository}}..." | |
arduino-cli compile -v -b esp32:esp32:esp32 --build-properties build.partitions=minimal,upload.maximum_size=1966080 --output-dir build ESP32-SOCKETIO | |
- name: Create spiffs binary | |
run: | | |
/home/runner/.arduino15/packages/esp32/tools/mkspiffs/0.2.3/mkspiffs -c ESP32-SOCKETIO/data -b 4096 -p 256 -s 0xB0000 build/spiffs.bin | |
- name: Upload binaries | |
uses: actions/upload-artifact@v2 | |
with: | |
name: binaries | |
path: | | |
build/ESP32-SOCKETIO.ino.bin | |
build/ESP32-SOCKETIO.ino.partitions.bin | |
build/ESP32-SOCKETIO.ino.bootloader.bin | |
- name: Create Release | |
id: create_release | |
uses: actions/create-release@v1 | |
if: startsWith(github.ref, 'refs/tags/v') | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ github.ref }} | |
release_name: Yo-Yo Machines Firmware ${{ github.ref }} | |
draft: true | |
prerelease: false | |
- name: Upload binaries to Release | |
id: upload-release-asset | |
uses: actions/upload-release-asset@v1 | |
if: startsWith(github.ref, 'refs/tags/v') | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: build/ | |
asset_name: binaries | |
asset_content_type: application/octet-stream |