Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

release-plz #2

Merged
merged 5 commits into from
Nov 23, 2024
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
32 changes: 32 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: pr

on:
pull_request:
branches: ["main"]

env:
CARGO_TERM_COLOR: always

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

# Install Rust with clippy/rustfmt
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
target: wasm32-unknown-unknown
components: clippy, rustfmt

# Set RUSTFLAGS
- run: echo "RUSTFLAGS=--cfg=web_sys_unstable_apis" >> $GITHUB_ENV

# Make sure u guys don't write bad code
- run: cargo check
- run: cargo clippy --no-deps
- run: cargo fmt --check

# Check for unused dependencies
- uses: bnjbvr/cargo-machete@main
30 changes: 30 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: release

permissions:
pull-requests: write
contents: write

on:
push:
branches:
- main

jobs:
release:
runs-on: ubuntu-latest
steps:
# Checkout the repository
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0

# Instal Rust
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable

# Run release-plz to create PRs and releases
- name: Run release-plz
uses: MarcoIeni/[email protected]
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
1 change: 1 addition & 0 deletions src/audio/decoder.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

1 change: 1 addition & 0 deletions src/audio/encoder.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

3 changes: 0 additions & 3 deletions src/audio/mod.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
mod decoder;
mod encoder;

pub use decoder::*;
pub use encoder::*;
20 changes: 13 additions & 7 deletions src/video/color.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,36 @@ pub struct ColorSpaceConfig {
inner: web_sys::VideoColorSpaceInit,
}

impl Default for ColorSpaceConfig {
fn default() -> Self {
Self::new()
}
}

impl ColorSpaceConfig {
pub fn new() -> Self {
Self {
inner: web_sys::VideoColorSpaceInit::new(),
}
}

pub fn full_range(mut self, enabled: bool) -> Self {
pub fn full_range(self, enabled: bool) -> Self {
self.inner.set_full_range(enabled);
self
}

pub fn matrix(mut self, matrix: MatrixCoefficients) -> Self {
self.inner.set_matrix(matrix.into());
pub fn matrix(self, matrix: MatrixCoefficients) -> Self {
self.inner.set_matrix(matrix);
self
}

pub fn primaries(mut self, primaries: ColorPrimaries) -> Self {
self.inner.set_primaries(primaries.into());
pub fn primaries(self, primaries: ColorPrimaries) -> Self {
self.inner.set_primaries(primaries);
self
}

pub fn transfer(mut self, transfer: TransferCharacteristics) -> Self {
self.inner.set_transfer(transfer.into());
pub fn transfer(self, transfer: TransferCharacteristics) -> Self {
self.inner.set_transfer(transfer);
self
}
}
Expand Down
1 change: 0 additions & 1 deletion src/video/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,4 @@ mod frame;

pub use color::*;
pub use decoder::*;
pub use encoder::*;
pub use frame::*;
Loading