Skip to content

Commit

Permalink
Merge pull request #1 from TurtIeSocks/rework
Browse files Browse the repository at this point in the history
Rework
  • Loading branch information
TurtIeSocks authored Nov 5, 2024
2 parents f4516b5 + c309797 commit 0da1284
Show file tree
Hide file tree
Showing 31 changed files with 2,292 additions and 390 deletions.
94 changes: 94 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
# Based on https://github.com/actions-rs/meta/blob/master/recipes/quickstart.md

on:
push:
branches: [main]
pull_request:
branches: [main]

name: Continuous Integration

jobs:
check:
name: Run cargo check
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v3

- name: Install stable toolchain
uses: dtolnay/rust-toolchain@stable

- name: Install Linux dependencies
run: sudo apt-get update; sudo apt-get install pkg-config libx11-dev libasound2-dev libudev-dev libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev

- name: Run cargo check
run: cargo check --all-targets

- name: Run cargo check with all feature
run: cargo check --all-targets --all-features

- name: Run cargo check headless
run: cargo check --all-targets --no-default-features

docs:
name: Run cargo doc
env:
RUSTDOCFLAGS: -D warnings
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v3

- name: Install stable toolchain
uses: dtolnay/rust-toolchain@stable

- name: Install Linux dependencies
run: sudo apt-get update; sudo apt-get install pkg-config libx11-dev libasound2-dev libudev-dev libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev

- name: Run cargo doc
run: cargo doc --features="inspect" --no-deps

build_examples:
name: Build examples
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v3

- name: Install stable toolchain
uses: dtolnay/rust-toolchain@stable

- name: Install Linux dependencies
run: sudo apt-get update; sudo apt-get install pkg-config libx11-dev libasound2-dev libudev-dev libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev

- name: Build examples without inspect feature
run: cargo build --examples --features="ogg"

- name: Clean
run: cargo clean

- name: Build examples with all features
run: cargo build --examples --all-features

# test:
# name: Tests
# strategy:
# # Tests are most likely to have OS-specific behavior
# matrix:
# os: [ubuntu-latest, windows-latest, macOS-latest]

# runs-on: ${{ matrix.os }}
# steps:
# - name: Checkout sources
# uses: actions/checkout@v3

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

# - name: Install Linux dependencies
# if: ${{ matrix.os == 'ubuntu-latest' }}
# run: sudo apt-get install --no-install-recommends libwayland-dev libxkbcommon-dev

# - name: Run cargo test
# run: cargo test
47 changes: 47 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Publish to crates.io

on:
push:
tags:
- v[0-9]+.[0-9]+.[0-9]+

jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Check out the code
uses: actions/checkout@v3

- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true

- name: Cache Cargo registry
uses: actions/cache@v3
with:
path: ~/.cargo/registry
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-registry-
- name: Cache Cargo index
uses: actions/cache@v3
with:
path: ~/.cargo/git
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-index-
- name: Install toml-cli
run: cargo install toml-cli
- name: Check version
run: test "v$(toml get -r Cargo.toml package.version)" = "${{ github.ref_name }}"

- name: Build and verify the crate
run: cargo publish --dry-run

- name: Publish to crates.io
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
run: cargo publish
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"editor.formatOnSave": true,
"editor.formatOnSave": true
}
11 changes: 10 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

63 changes: 46 additions & 17 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "bevy_audio_controller"
version = "0.1.0"
version = "0.2.0"
edition = "2021"
authors = ["TurtIeSocks"]
license = "MIT OR Apache-2.0"
Expand All @@ -10,23 +10,15 @@ homepage = "https://github.com/TurtIeSocks/bevy_audio_controller"
keywords = ["bevy", "gamedev", "audio", "music"]
categories = ["game-development", "multimedia::audio"]
readme = "./README.md"
exclude = ["assets/"]

[lib]
path = "src/lib.rs"

[dependencies]
bevy = { version = "0.14", default-features = false, features = [
"bevy_audio",
"bevy_asset",
] }

[build-dependencies]
symphonia = { version = "0.5", default-features = false }
cargo-emit = "0.2.1"
[workspace]
members = ["macros"]

[features]
# Dev mode
# default = ["all-codecs", "inspect"]
default = []

inspect = []

# Pass features to symphonia
Expand All @@ -48,6 +40,18 @@ wav = ["symphonia/wav", "symphonia/pcm", "bevy/wav"]

all-codecs = ["flac", "mp3", "ogg", "wav"]


[dependencies]
bevy = { version = "0.14", default-features = false, features = [
"bevy_audio",
"bevy_asset",
] }
bevy_audio_controller_derive = { path = "./macros" }

[build-dependencies]
symphonia = { version = "0.5", default-features = false }
cargo-emit = "0.2.1"

[dev-dependencies]
bevy = { version = "0.14", features = [
"bevy_audio",
Expand All @@ -63,6 +67,31 @@ path = "examples/basic.rs"
required-features = ["ogg"]

[[example]]
name = "advanced"
path = "examples/advanced.rs"
required-features = ["ogg", "inspect"]
name = "channels"
path = "examples/channels.rs"
required-features = ["ogg"]

[[example]]
name = "event_options"
path = "examples/event_options.rs"
required-features = ["ogg"]

[[example]]
name = "querying"
path = "examples/querying.rs"
required-features = ["ogg"]

[[example]]
name = "ecs"
path = "examples/ecs.rs"
required-features = ["ogg"]

[[example]]
name = "volume"
path = "examples/volume.rs"
required-features = ["ogg"]

[[example]]
name = "delays"
path = "examples/delays.rs"
required-features = ["ogg"]
Loading

0 comments on commit 0da1284

Please sign in to comment.