Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,21 +50,18 @@ jobs:
- name: Run clippy action
uses: clechasseur/rs-clippy-check@v5
doc:
# run docs generation on nightly rather than stable. This enables features like
# https://doc.rust-lang.org/beta/unstable-book/language-features/doc-cfg.html which allows an
# API be documented as only available in some specific platforms.
name: doc
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Install Rust nightly
uses: dtolnay/rust-toolchain@nightly
- name: Install Rust stable
uses: dtolnay/rust-toolchain@stable
- name: Cache Cargo dependencies
uses: Swatinem/rust-cache@v2
- name: Run cargo doc
run: cargo doc --no-deps --all-features
env:
RUSTDOCFLAGS: --cfg docsrs
RUSTDOCFLAGS: -D warnings
test:
runs-on: ${{ matrix.os }}
name: test ${{ matrix.os }}
Expand All @@ -78,11 +75,17 @@ jobs:
uses: dtolnay/rust-toolchain@stable
- name: Install libmpv (Linux)
if: runner.os == 'Linux'
run: sudo apt-get install -y libmpv-dev
run: |
sudo apt-get update
sudo apt-get install -y libmpv-dev
- name: Install libmpv (Mac)
if: runner.os == 'macOS'
run: |
brew install mpv
BREW_PREFIX="$(brew --prefix)"
echo "C_INCLUDE_PATH=$BREW_PREFIX/include:$C_INCLUDE_PATH" >> $GITHUB_ENV
echo "LIBRARY_PATH=$BREW_PREFIX/lib:$LIBRARY_PATH" >> $GITHUB_ENV
echo "PKG_CONFIG_PATH=$BREW_PREFIX/lib/pkgconfig:$PKG_CONFIG_PATH" >> $GITHUB_ENV
- name: cargo generate-lockfile
if: hashFiles('Cargo.lock') == ''
run: cargo generate-lockfile
Expand Down
56 changes: 50 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Release
on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
- "v[0-9]+.[0-9]+.[0-9]+"

env:
CARGO_TERM_COLOR: always
Expand All @@ -22,9 +22,15 @@ jobs:
- os: macos-latest
target: aarch64-apple-darwin
artifact: classfi-aarch64-apple-darwin.tar.gz
- os: macos-13
target: x86_64-apple-darwin
artifact: classfi-x86_64-apple-darwin.tar.gz
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
artifact: classfi-x86_64-unknown-linux-gnu.tar.gz
- os: ubuntu-24.04-arm
target: aarch64-unknown-linux-gnu
artifact: classfi-aarch64-unknown-linux-gnu.tar.gz
steps:
- uses: actions/checkout@v6

Expand All @@ -40,32 +46,48 @@ jobs:

- name: Install libmpv (Linux)
if: runner.os == 'Linux'
run: sudo apt-get install -y libmpv-dev
run: |
sudo apt-get update
sudo apt-get install -y libmpv-dev

- name: Install libmpv (macOS)
if: runner.os == 'macOS'
run: |
brew install mpv
echo "C_INCLUDE_PATH=/opt/homebrew/include:$C_INCLUDE_PATH" >> $GITHUB_ENV
echo "LIBRARY_PATH=/opt/homebrew/lib:$LIBRARY_PATH" >> $GITHUB_ENV
echo "PKG_CONFIG_PATH=/opt/homebrew/lib/pkgconfig:$PKG_CONFIG_PATH" >> $GITHUB_ENV
BREW_PREFIX="$(brew --prefix)"
echo "C_INCLUDE_PATH=$BREW_PREFIX/include:$C_INCLUDE_PATH" >> $GITHUB_ENV
echo "LIBRARY_PATH=$BREW_PREFIX/lib:$LIBRARY_PATH" >> $GITHUB_ENV
echo "PKG_CONFIG_PATH=$BREW_PREFIX/lib/pkgconfig:$PKG_CONFIG_PATH" >> $GITHUB_ENV

- name: Build release binary
run: cargo build --release --locked --target ${{ matrix.target }}

- name: Smoke test binary
run: ./target/${{ matrix.target }}/release/classfi --version

- name: Package binary
run: |
cd target/${{ matrix.target }}/release
tar -czf ../../../${{ matrix.artifact }} classfi
cd -
shasum -a 256 ${{ matrix.artifact }} > ${{ matrix.artifact }}.sha256

- name: Upload release artifact
uses: softprops/action-gh-release@v3
with:
files: ${{ matrix.artifact }}
files: |
${{ matrix.artifact }}
${{ matrix.artifact }}.sha256
body: |
## Installation

Each tarball ships with a matching `.sha256` file. To verify a
download before installing:
```sh
curl -LO https://github.com/${{ github.repository }}/releases/download/${{ github.ref_name }}/<artifact>.sha256
shasum -a 256 -c <artifact>.sha256
```

### macOS (Apple Silicon)
```sh
brew install mpv
Expand All @@ -75,6 +97,15 @@ jobs:
sudo mv classfi /usr/local/bin/
```

### macOS (Intel)
```sh
brew install mpv
curl -Lo classfi.tar.gz https://github.com/${{ github.repository }}/releases/download/${{ github.ref_name }}/classfi-x86_64-apple-darwin.tar.gz
tar -xzf classfi.tar.gz
chmod +x classfi
sudo mv classfi /usr/local/bin/
```

### Linux (x86_64)
```sh
# Install mpv via your distro's package manager, e.g.:
Expand All @@ -87,5 +118,18 @@ jobs:
chmod +x classfi
sudo mv classfi /usr/local/bin/
```

### Linux (ARM64 / aarch64)
```sh
# Install mpv via your distro's package manager, e.g.:
sudo apt install mpv # Debian/Ubuntu
sudo dnf install mpv # Fedora
sudo pacman -S mpv # Arch

curl -Lo classfi.tar.gz https://github.com/${{ github.repository }}/releases/download/${{ github.ref_name }}/classfi-aarch64-unknown-linux-gnu.tar.gz
tar -xzf classfi.tar.gz
chmod +x classfi
sudo mv classfi /usr/local/bin/
```
draft: false
prerelease: false
Loading
Loading