Skip to content

Commit

Permalink
Add build workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
ryze312 committed Jul 14, 2024
1 parent 38b50cc commit dff668c
Showing 1 changed file with 54 additions and 0 deletions.
54 changes: 54 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit dff668c

Please sign in to comment.