add workflow

This commit is contained in:
2024-11-10 01:05:24 +08:00
parent ff0076531b
commit 48b20bf311

View File

@@ -0,0 +1,41 @@
name: Build
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
env:
CARGO_TERM_COLOR: always
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Cache dependencies
uses: actions/cache@v3
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Build
run: cargo build --release
- name: Rename binary
run: mv target/release/audio-typing target/release/voice-typing
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: voice-typing
path: target/release/voice-typing