Add build workflow
This commit is contained in:
parent
38b50ccf4d
commit
dff668c760
1 changed files with 54 additions and 0 deletions
54
.github/workflows/build.yml
vendored
Normal file
54
.github/workflows/build.yml
vendored
Normal file
|
@ -0,0 +1,54 @@
|
|||
name: build-plugin
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
branches: [ main ]
|
||||
paths:
|
||||
- "src/**"
|
||||
- Cargo.lock
|
||||
- rust-toolchain.toml
|
||||
- flake.nix
|
||||
- flake.lock
|
||||
- shell.nix
|
||||
|
||||
pull_request:
|
||||
branches: [ main ]
|
||||
paths:
|
||||
- "src/**"
|
||||
- Cargo.lock
|
||||
- rust-toolchain.toml
|
||||
- flake.nix
|
||||
- flake.lock
|
||||
- shell.nix
|
||||
|
||||
env:
|
||||
CARGO_TERM_COLOR: always
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
profile: [ "dev", "release" ]
|
||||
|
||||
env:
|
||||
BUILD_NAME: ${{ matrix.profile == 'dev' && 'debug' || matrix.profile }}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Install Nix
|
||||
uses: nixbuild/nix-quick-install-action@v28
|
||||
|
||||
- name: Check
|
||||
run: nix develop --command cargo clippy --profile ${{ matrix.profile }} -- -D warnings
|
||||
|
||||
- name: Build
|
||||
run: nix develop --command cargo build --profile ${{ matrix.profile }}
|
||||
|
||||
- name: Upload build
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: mpv-rpc_${{ env.BUILD_NAME }}
|
||||
path: target/${{ env.BUILD_NAME }}/libmpv_rpc.so
|
Loading…
Reference in a new issue