Skip to content

Release

Release #38

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-build:
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: 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 wget unzip
wget 'https://github.com/esp-rs/espflash/releases/download/v3.2.0/cargo-espflash-x86_64-unknown-linux-musl.zip'
unzip cargo-espflash-x86_64-unknown-linux-musl.zip
mv cargo-espflash ~/.cargo/bin/
- 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: Upload binaries
uses: actions/upload-artifact@v3
with:
name: binaries
path: ./*.bin
build-archive:
name: Build Archive
needs: [rust-build]
permissions:
contents: write
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- name: Get tag or commit id
id: get-version-id
uses: iawia002/get-tag-or-commit-id@v1
with:
length: 7
- name: Download binaries
uses: actions/download-artifact@v3
with:
name: binaries
- name: Build archive
shell: bash
run: |
package_name="esparrier"
dirname="$package_name-${{ steps.get-version-id.outputs.id }}"
mkdir -p "$dirname"
cp $(pwd)/*.bin "$dirname"
# find . -name '*.bin' -exec cp {} "$dirname" \;
tar -czf "$dirname.tar.gz" "$dirname"
echo "ASSET=$dirname.tar.gz" >> $GITHUB_ENV
- name: Publish Release
uses: softprops/action-gh-release@v1
with:
files: |
${{ env.ASSET }}