Skip to content

Release

Release #27

Workflow file for this run

name: Release
on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
- "v[0-9]+.[0-9]+.[0-9]+-[a-zA-Z0-9]+"
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
jobs:
rust-checks:
name: Rust Build
permissions:
contents: write
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
models:
[
"generic",
"m5atoms3-lite",
"m5atoms3",
"xiao-esp32s3",
"devkitc-1_0",
"devkitc-1_1",
]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Get tag or commit id
id: get-version-id
uses: iawia002/get-tag-or-commit-id@v1
with:
length: 7
- name: Setup Rust
uses: esp-rs/xtensa-toolchain@v1.5
with:
default: true
buildtargets: esp32
ldproxy: false
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get -y install libudev-dev libusb-dev
- name: Install espflash
run: cargo install cargo-espflash
- name: Enable caching
uses: Swatinem/rust-cache@v2
- name: Build binary
run: cargo espflash save-image --chip esp32s3 --release --features ${{ matrix.models }} --partition-table partitions_single_app.csv esparrier-${{ matrix.models }}.bin
- name: Build merged binary
run: cargo espflash save-image --merge --chip esp32s3 --flash-size 1mb --release --features ${{ matrix.models }} --partition-table partitions_single_app.csv merged-esparrier-${{ matrix.models }}.bin
- name: Build archive
shell: bash
run: |
package_name="esparrier"
dirname="$package_name-${{ steps.get-version-id.outputs.id }}"
mkdir -p "$dirname"
cp "zero.bin" "$dirname"
cp "bootloader.bin" "$dirname"
cp "partition_table.bin" "$dirname"
mv "merged-esparrier-*.bin" "$dirname"
mv "esparrier-*.bin" "$dirname"
tar -czf "$dirname.tar.gz" "$dirname"
echo "ASSET=$dirname.tar.gz" >> $GITHUB_ENV
- name: Release
uses: softprops/action-gh-release@v1
with:
files: |
${{ env.ASSET }}