Add Raspberry Pi compilation #4
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: Publish | |
on: | |
push: | |
tags: | |
- "*" | |
jobs: | |
publish: | |
name: Publish for ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
include: | |
- os: ubuntu-latest | |
artifact_name: wifi-speaker | |
asset_name: wifi-speaker-linux | |
- os: windows-latest | |
artifact_name: wifi-speaker.exe | |
asset_name: wifi-speaker-windows.exe | |
- os: macos-latest | |
artifact_name: wifi-speaker | |
asset_name: wifi-speaker-macos | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install dependencies | |
run: sudo apt-get install -y libasound2-dev gcc-arm-linux-gnueabihf | |
if: matrix.os == 'ubuntu-latest' | |
- name: Build | |
run: cargo build --release --locked | |
- name: Compile for Raspberry Pi | |
run: | | |
rustup target add armv7-unknown-linux-gnueabihf | |
cargo build --release --target=armv7-unknown-linux-gnueabihf | |
if: matrix.os == 'ubuntu-latest' | |
- name: Upload Raspberry Pi binary to release | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
file: target/armv7-unknown-linux-gnueabihf/release/${{ matrix.artifact_name }} | |
asset_name: ${{ matrix.asset_name }}-rpi | |
tag: ${{ github.ref }} | |
if: matrix.os == 'ubuntu-latest' | |
- name: Upload binaries to release | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
file: target/release/${{ matrix.artifact_name }} | |
asset_name: ${{ matrix.asset_name }} | |
tag: ${{ github.ref }} |