Build and Release PlatformIO Project #25
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 and Release PlatformIO Project | |
on: | |
release: | |
types: [created] | |
jobs: | |
build: | |
runs-on: self-hosted | |
strategy: | |
matrix: | |
board: [esp32_s2, esp32_c3, lolin_s2_mini, dev_board_pro, marauder_minion] | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 # Necessary to fetch all tags and history | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.x' | |
- name: Install PlatformIO | |
run: pip install platformio | |
- name: Build with PlatformIO | |
run: platformio run --environment ${{ matrix.board }} | |
- name: Tar artifacts | |
run: tar -czvf ${{ matrix.board }}.tar.gz -C .pio/build/${{ matrix.board }} firmware.bin partitions.bin bootloader.bin | |
# Upload assets to the newly created release | |
- name: Upload assets to Release | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
file: ${{ matrix.board }}.tar.gz | |
asset_name: ${{ matrix.board }}.tar.gz | |
tag: ${{ github.ref_name }} # Use the tag name of the created release | |
overwrite: true |