Skip to content

add github action

add github action #1

Workflow file for this run

name: Build
on: [push, pull_request]
jobs:
build:
strategy:
matrix:
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
binary: my-app
- os: windows-latest
target: x86_64-pc-windows-msvc
binary: my-app.exe
- os: macos-latest
target: x86_64-apple-darwin
binary: my-app
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
components: clippy, rustfmt
targets: ${{ matrix.target }}
- uses: Swatinem/rust-cache@v2
- name: Format check
run: cargo fmt --check
- name: Clippy
run: cargo clippy -- -D warnings
- run: cargo build --release
- run: cargo test
- name: Rename binary
shell: bash
run: |
cp target/${{ matrix.target }}/release/${{ matrix.binary }} \
bsky-firehose-${{ matrix.target }}
- name: Upload binary
uses: softprops/action-gh-release@v2
with:
files: bsky-firehose-${{ matrix.target }}