18 Commits

Author SHA1 Message Date
Ryan Walters
46876d5d9d chore: remove unused 'serde_json' 2025-08-20 14:52:48 -05:00
Ryan Walters
e578ac2f3d ci: remove MUSL linux target, include bundles in artifact upload 2025-08-20 14:30:27 -05:00
Ryan Walters
d0aea1662d ci: disable sccache on Linux 2025-08-20 14:22:51 -05:00
Ryan Walters
7b52f87d9d ci: remove license-check job 2025-08-20 13:29:11 -05:00
Ryan Walters
7b7e495fc0 ci: add separate MUSL linux build, disable sccache on GNU linux only 2025-08-20 13:29:11 -05:00
Ryan Walters
8c897209ae ci: drop cargo-audit, use cargo deny, add config, working checks 2025-08-20 13:23:07 -05:00
Ryan Walters
b7d90c151c ci: attempt apt package caching 2025-08-20 12:49:08 -05:00
Ryan Walters
8c5e86be19 ci: deduplicate artifact_path, derive from target, rename step names 2025-08-20 12:46:36 -05:00
Ryan Walters
a2c4a0bd0c ci: remove push/pull_request path filtering for qualit/audit checks 2025-08-20 12:42:38 -05:00
Ryan Walters
6c2c10c25d ci: use official sccache github action 2025-08-20 12:42:38 -05:00
Ryan Walters
fc47fd9fe9 ci: simplify target matrix, fail on missing files, run generate-types before 2025-08-20 12:42:38 -05:00
Ryan Walters
f507277827 ci: omit patch+minor instead of using ^version pattern 2025-08-20 12:42:37 -05:00
Ryan Walters
51498b234e ci: use tauri-cli from cargo, add cargo fetch step 2025-08-20 12:42:37 -05:00
Ryan Walters
e35ac0eeee ci: build backend properly, matrix target all major platforms, artifact upload 2025-08-20 12:42:37 -05:00
Ryan Walters
047ee8b1e4 ci: improve caching, use taiki-e/install-action where possible, add sccache, optimize dependency setup 2025-08-20 12:17:47 -05:00
Xevion
50f53eccf1 Merge pull request #5 from Xevion/dependabot/github_actions/actions/checkout-5
chore(deps): bump actions/checkout from 4 to 5
2025-08-20 09:25:15 -05:00
Ryan Walters
ca82456a53 fix: use proper path, specify all models, place test in models.rs 2025-08-20 08:47:08 -05:00
dependabot[bot]
19a39a8c25 chore(deps): bump actions/checkout from 4 to 5
Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to 5.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-08-20 13:26:42 +00:00
10 changed files with 136 additions and 110 deletions

View File

@@ -10,14 +10,52 @@ env:
jobs:
build:
runs-on: ubuntu-latest
name: Build (${{ matrix.os }}${{ matrix.target && format(' / {0}', matrix.target) || '' }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-22.04
target: x86_64-unknown-linux-gnu
artifact_name: byte-me-linux-x86_64
- os: windows-latest
target: x86_64-pc-windows-msvc
artifact_name: byte-me-windows-x86_64
artifact_extension: .exe
- os: macos-latest
target: aarch64-apple-darwin
artifact_name: byte-me-macos-aarch64
- os: macos-latest
target: x86_64-apple-darwin
artifact_name: byte-me-macos-x86_64
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v5
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
targets: ${{ matrix.target }}
- name: Use sccache
if: runner.os != 'Linux' && github.event_name != 'release' && github.event_name != 'workflow_dispatch'
uses: mozilla-actions/sccache-action@v0.0.9
- name: Configure sccache
if: runner.os != 'Linux' && github.event_name != 'release' && github.event_name != 'workflow_dispatch'
run: |
# Enable GitHub Actions for cache storage
echo "SCCACHE_GHA_ENABLED=true" >> $GITHUB_ENV
# Use sccache for rustc
echo "RUSTC_WRAPPER=sccache" >> $GITHUB_ENV
- name: Rust cache
uses: Swatinem/rust-cache@v2
with:
workspaces: src-tauri
- name: Setup pnpm
uses: pnpm/action-setup@v4
@@ -30,36 +68,52 @@ jobs:
node-version: 20
cache: "pnpm"
- name: Install JS deps
run: pnpm install --frozen-lockfile
- name: Install frontend dependencies
run: pnpm install --frozen-lockfile --prefer-offline
- name: Install backend dependencies
run: cargo fetch --manifest-path src-tauri/Cargo.toml
- name: Install Tauri CLI
uses: Xevion/cache-cargo-install-action@main
with:
tool: tauri-cli@2
locked: true
- name: Cache apt packages
if: runner.os == 'Linux'
uses: actions/cache@v4
with:
path: /var/cache/apt/archives
key: ${{ runner.os }}-apt-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-apt-
- name: Install Linux dependencies
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y \
pkg-config \
# Update package list and install dependencies in one command to reduce time
sudo apt-get update -qq && sudo apt-get install -y --no-install-recommends \
build-essential \
libxdo-dev \
libssl-dev \
libglib2.0-dev \
libwebkit2gtk-4.1-dev \
libayatana-appindicator3-dev \
librsvg2-dev \
patchelf
patchelf \
musl-tools
# this will run again in next step, but we run it here to separate the error from the frontend build step
- name: Generate frontend bindings
run: pnpm run generate-types
- name: Build frontend (tsc + vite)
run: |
pnpm run build # implicitly runs generate-types
- name: Build app (tauri)
run: cargo tauri build --target ${{ matrix.target }}
- name: Format check
run: cargo fmt --manifest-path src-tauri/Cargo.toml --all -- --check
- name: Clippy
run: cargo clippy --manifest-path src-tauri/Cargo.toml --all-targets --all-features -- -D warnings
- name: Run tests
run: cargo test --manifest-path src-tauri/Cargo.toml --all-features
- name: Upload binary artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.artifact_name }}
path: |
src-tauri/target/${{ matrix.target }}/release/byte-me${{ matrix.artifact_extension }}
src-tauri/target/${{ matrix.target }}/release/bundle/**/*
if-no-files-found: error

View File

@@ -6,25 +6,15 @@ on:
workflow_dispatch: # Allow manual triggering
pull_request:
branches: [master]
paths:
- "**/Cargo.toml"
- "**/Cargo.lock"
- "**/package.json"
- "**/pnpm-lock.yaml"
push:
branches: [master]
paths:
- "**/Cargo.toml"
- "**/Cargo.lock"
- "**/package.json"
- "**/pnpm-lock.yaml"
jobs:
rust-quality:
name: Rust Code Quality
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@nightly
@@ -51,17 +41,13 @@ jobs:
patchelf
- name: Install cargo-udeps
uses: taiki-e/cache-cargo-install-action@v2
with:
tool: cargo-udeps
uses: taiki-e/install-action@cargo-udeps
- name: Check for unused dependencies
run: cargo +nightly udeps --manifest-path src-tauri/Cargo.toml --all-targets
- name: Install cargo-machete
uses: taiki-e/cache-cargo-install-action@v2
with:
tool: cargo-machete
uses: taiki-e/install-action@cargo-machete
- name: Check for unused Cargo.toml dependencies
run: cargo machete src-tauri/
@@ -79,7 +65,7 @@ jobs:
name: Frontend Code Quality
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- name: Install pnpm
uses: pnpm/action-setup@v4
@@ -106,38 +92,3 @@ jobs:
- name: Bundle size analysis
run: pnpm run build && du -sh dist/
continue-on-error: true
license-check:
name: License Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Install cargo-license
uses: taiki-e/cache-cargo-install-action@v2
with:
tool: cargo-license
- name: Check Rust crate licenses
run: cargo license --manifest-path src-tauri/Cargo.toml --json > rust-licenses.json
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 10
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: pnpm
- name: Install dependencies
run: pnpm install
- name: Check npm package licenses
run: pnpm exec license-checker --json > npm-licenses.json
continue-on-error: true

View File

@@ -23,7 +23,7 @@ jobs:
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- name: Install pnpm
uses: pnpm/action-setup@v4

View File

@@ -3,36 +3,25 @@ name: Security Audit
on:
workflow_dispatch: # Allow manual triggering
push:
paths:
- "**/Cargo.toml"
- "**/Cargo.lock"
- "**/package.json"
- "**/pnpm-lock.yaml"
jobs:
rust-audit:
name: Rust Security Audit
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install cargo-audit
uses: taiki-e/install-action@cargo-audit
- name: Run cargo audit
run: cargo audit --file src-tauri/Cargo.lock
- uses: actions/checkout@v5
- name: Install cargo-deny
uses: taiki-e/install-action@cargo-deny
- name: Run cargo deny
run: cargo deny --manifest-path src-tauri/Cargo.toml check
run: cargo deny --manifest-path src-tauri/Cargo.toml check sources advisories bans --show-stats
npm-audit:
name: NPM Security Audit
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- name: Install pnpm
uses: pnpm/action-setup@v4

1
src-tauri/Cargo.lock generated
View File

@@ -398,7 +398,6 @@ dependencies = [
"ffprobe",
"infer",
"serde",
"serde_json",
"tauri",
"tauri-build",
"tauri-plugin-opener",

View File

@@ -21,7 +21,6 @@ tauri-build = { version = "2.4.0", features = [] }
tauri = { version = "2.8.2", features = [] }
tauri-plugin-opener = "2.5.0"
serde = { version = "1", features = ["derive"] }
serde_json = "1.0.143"
ffprobe = "0.4.0"
ts-rs = { version = "11.0", features = ["format"] }
infer = "0.19.0"

39
src-tauri/deny.toml Normal file
View File

@@ -0,0 +1,39 @@
[graph]
targets = [
"x86_64-unknown-linux-gnu",
"x86_64-pc-windows-msvc",
"aarch64-apple-darwin",
"x86_64-apple-darwin",
]
all-features = true
no-default-features = false
[output]
feature-depth = 1
[advisories]
ignore = [
"RUSTSEC-2024-0429",
]
unmaintained = "workspace"
[licenses]
allow = []
confidence-threshold = 0.8
exceptions = []
[licenses.private]
ignore = false
registries = []
[bans]
multiple-versions = "allow"
wildcards = "allow"
highlight = "all"
workspace-default-features = "allow"
external-default-features = "allow"
allow = []
[sources]
unknown-registry = "warn"
unknown-git = "warn"

View File

@@ -43,5 +43,3 @@ pub fn extract_streams(info: &ffprobe::FfProbe) -> Vec<StreamDetail> {
streams
}

View File

@@ -96,16 +96,3 @@ pub fn run() {
.run(tauri::generate_context!())
.expect("error while running tauri application");
}
#[cfg(test)]
mod tests {
use ts_rs::TS;
#[test]
fn export_bindings() {
// This will generate TypeScript bindings when you run `cargo test export_bindings`
use crate::models::*;
StreamDetail::export_all_to("../../src/bindings").expect("Failed to export bindings");
}
}

View File

@@ -2,7 +2,6 @@ use serde::{Deserialize, Serialize};
use ts_rs::TS;
#[derive(Serialize, Deserialize, Debug, Clone, TS)]
#[ts(export)]
pub enum MediaType {
Audio,
Video,
@@ -15,7 +14,6 @@ pub enum MediaType {
}
#[derive(Serialize, Deserialize, Debug, Clone, TS)]
#[ts(export)]
pub struct StreamResult {
pub path: String,
pub filename: String,
@@ -26,7 +24,6 @@ pub struct StreamResult {
}
#[derive(Serialize, Deserialize, Debug, Clone, TS)]
#[ts(export)]
pub enum StreamDetail {
Video {
codec: String,
@@ -48,9 +45,22 @@ pub enum StreamDetail {
}
#[derive(Serialize, Deserialize, Debug, Clone, TS)]
#[ts(export)]
pub struct StreamResultError {
pub filename: Option<String>,
pub reason: String,
pub error_type: String,
}
#[cfg(test)]
mod tests {
#[test]
fn export_bindings() {
// This will generate TypeScript bindings when you run `cargo test export_bindings`
use super::*;
StreamDetail::export_all_to("../src/bindings").expect("Failed to export bindings");
StreamResult::export_all_to("../src/bindings").expect("Failed to export bindings");
StreamResultError::export_all_to("../src/bindings").expect("Failed to export bindings");
MediaType::export_all_to("../src/bindings").expect("Failed to export bindings");
}
}