diff --git a/.github/workflows/coreaudio-rs.yml b/.github/workflows/coreaudio-rs.yml new file mode 100644 index 000000000..8647c191d --- /dev/null +++ b/.github/workflows/coreaudio-rs.yml @@ -0,0 +1,60 @@ +name: coreaudio-rs +on: [push, pull_request] +jobs: + # Run cargo test with default, no and all features. + macos-test: + runs-on: macOS-latest + steps: + - uses: actions/checkout@v2 + - name: Install llvm and clang + run: brew install llvm + - name: Install stable + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + override: true + - name: cargo test + run: cargo test --verbose + # TODO: These don't work as of 2020-12-06, but they should. + # - name: cargo test - no features + # run: cargo test --no-default-features --verbose + # - name: cargo test - all features + # run: cargo test --all-features --verbose + + # Build the docs with all features to make sure docs.rs will work. + macos-docs: + runs-on: macOS-latest + steps: + - uses: actions/checkout@v2 + - name: Install llvm and clang + run: brew install llvm + - name: Install stable + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + override: true + - name: cargo doc - all features + run: cargo doc --all-features --verbose + + # Publish a new version when pushing to master. + # Will succeed if the version has been updated, otherwise silently fails. + cargo-publish: + if: github.event_name == 'push' && github.ref == 'refs/heads/master' + env: + CRATESIO_TOKEN: ${{ secrets.CRATESIO_TOKEN }} + runs-on: macOS-latest + steps: + - uses: actions/checkout@v2 + - name: Install llvm and clang + run: brew install llvm + - name: Install stable + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + override: true + - name: cargo publish + continue-on-error: true + run: cargo publish --token $CRATESIO_TOKEN diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index e2c80ecd9..000000000 --- a/.travis.yml +++ /dev/null @@ -1,36 +0,0 @@ -language: rust -rust: -- stable -- beta -- nightly -notifications: - email: - - mitchell.nordine@gmail.com -os: -- osx -env: - matrix: - - LD_LIBRARY_PATH: /usr/local/lib - global: - - secure: URNNlOqxnfwWDC/w4PDTCswqe9ccnkIqDwfQecppfEui4KhpYXfrG9gx3xupWzWMfX+NPEcXtiyWA4CuUYaHbWWINLeLQUk650AFEqaRSiTpeh45Y9nh3dHT4fFDz4OeNfayNBBKL0kx5YwrugoeQggIgnF2KEcIHMF0+BbTtAM= -install: -- rustup target add aarch64-apple-ios x86_64-apple-ios -before_script: -- rustc --version -- cargo --version -script: -- cargo build --verbose -- cargo test --verbose -- cargo doc --verbose -- cargo build --verbose --target aarch64-apple-ios -- cargo build --verbose --target x86_64-apple-ios -after_success: | - [ $TRAVIS_BRANCH = master ] && - [ $TRAVIS_PULL_REQUEST = false ] && - cargo doc && - echo "" > target/doc/index.html && - pip install --user ghp-import && - ghp-import -n target/doc && - # Redirect any output to `/dev/null` to hide any sensitive - # credential data that might otherwise be exposed. - git push -fq https://${GH_TOKEN}@github.com/${TRAVIS_REPO_SLUG}.git gh-pages > /dev/null 2>&1 diff --git a/Cargo.toml b/Cargo.toml index e64a073fd..2c156c5c9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -23,3 +23,8 @@ core_midi = ["coreaudio-sys/core_midi"] [dependencies] bitflags = "1.0" coreaudio-sys = { version = "0.2", default-features = false } + +[package.metadata.docs.rs] +all-features = true +default-target = "x86_64-apple-darwin" +targets = ["x86_64-apple-darwin", "x86_64-apple-ios"] diff --git a/README.md b/README.md index 4108361f1..36c1e4903 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,7 @@ -# coreaudio-rs [![Build Status](https://travis-ci.org/RustAudio/coreaudio-rs.svg?branch=master)](https://travis-ci.org/RustAudio/coreaudio-rs) [![Crates.io](https://img.shields.io/crates/v/coreaudio-rs.svg)](https://crates.io/crates/coreaudio-rs) [![Crates.io](https://img.shields.io/crates/l/coreaudio-rs.svg)](https://github.com/RustAudio/coreaudio-rs/blob/master/LICENSE-MIT) +# coreaudio-rs [![Actions Status](https://github.com/rustaudio/coreaudio-rs/workflows/coreaudio-rs/badge.svg)](https://github.com/rustaudio/coreaudio-rs/actions) [![Crates.io](https://img.shields.io/crates/v/coreaudio-rs.svg)](https://crates.io/crates/coreaudio-rs) [![Crates.io](https://img.shields.io/crates/l/coreaudio-rs.svg)](https://github.com/RustAudio/coreaudio-rs/blob/master/LICENSE-MIT) [![docs.rs](https://docs.rs/coreaudio-rs/badge.svg)](https://docs.rs/coreaudio-rs/) A friendly rust interface for [Apple's Core Audio API](https://developer.apple.com/library/ios/documentation/MusicAudio/Conceptual/CoreAudioOverview/CoreAudioEssentials/CoreAudioEssentials.html). This crate aims to expose and wrap the functionality of the original C API in a zero-cost, safe, Rust-esque manner. If you just want direct access to the unsafe bindings, use [coreaudio-sys](https://crates.io/crates/coreaudio-sys). - -[Documentation](http://rustaudio.github.io/coreaudio-rs/coreaudio)