From a4d08292542b77f72ad546a8aaaef4649e49a9ee Mon Sep 17 00:00:00 2001 From: mitchmindtree Date: Wed, 24 Jun 2020 18:37:38 +0200 Subject: [PATCH 1/7] Ensure docs.rs defaults to apple darwin docs --- Cargo.toml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Cargo.toml b/Cargo.toml index 053bfd0..56d86da 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -22,3 +22,8 @@ audio_unit = [] core_audio = [] open_al = [] core_midi = [] + +[package.metadata.docs.rs] +all-features = true +default-target = "x86_64-apple-darwin" +targets = ["x86_64-apple-darwin", "x86_64-apple-ios"] From 462b5b2ebbdfa18af65715c65ba0cd6e014871c3 Mon Sep 17 00:00:00 2001 From: mitchmindtree Date: Wed, 24 Jun 2020 18:51:55 +0200 Subject: [PATCH 2/7] Add github CI and auto-publish workflow --- .github/workflows/coreaudio-sys.yml | 68 +++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 .github/workflows/coreaudio-sys.yml diff --git a/.github/workflows/coreaudio-sys.yml b/.github/workflows/coreaudio-sys.yml new file mode 100644 index 0000000..32f3a64 --- /dev/null +++ b/.github/workflows/coreaudio-sys.yml @@ -0,0 +1,68 @@ +name: coreaudio-sys +on: [push, pull_request] +jobs: + # Run cargo test with default, no and all features. + # Also build the docs with all features to make sure docs.rs will work. + 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 + - name: cargo test - no features + run: cargo test --no-default-features --verbose + - name: cargo test - all features + run: cargo test --all-features --verbose + - name: cargo doc - all features + run: cargo doc --all-features --verbose + + # Check that cross-compilation from linux is working. + # TODO: This is adapted from old travis file, should probably also: + # - Check more feature permutations. + # - Use more recent SDK? Looks like 10.13 is used atm. + # - Check iOS target? + linux-cross-compile: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Install stable + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + override: true + - name: Add apple target + run: rustup target add x86_64-apple-darwin + - name: Download SDK + run: curl -sL https://github.com/phracker/MacOSX-SDKs/releases/download/10.13/MacOSX10.13.sdk.tar.xz | tar -Jxf -; export COREAUDIO_SDK_PATH="$PWD/MacOSX10.13.sdk" + - name: Cargo build + run: cargo build --verbose --target=x86_64-apple-darwin + + # 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 From a29b148e97a12c151395d9c33971ee8716cb8420 Mon Sep 17 00:00:00 2001 From: mitchmindtree Date: Wed, 24 Jun 2020 19:01:39 +0200 Subject: [PATCH 3/7] Remove old .travis.yml config --- .travis.yml | 20 -------------------- 1 file changed, 20 deletions(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index c48317b..0000000 --- a/.travis.yml +++ /dev/null @@ -1,20 +0,0 @@ -language: rust -rust: -- stable -- beta -- nightly -notifications: - email: - - mitchell.nordine@gmail.com -os: -- osx -- linux -before_script: -- rustc --version -- cargo --version -- rustup component add rustfmt -- if [ "$TRAVIS_OS_NAME" = linux ]; then rustup target add x86_64-apple-darwin; fi -script: -- if [ "$TRAVIS_OS_NAME" = linux ]; then curl -sL https://github.com/phracker/MacOSX-SDKs/releases/download/10.13/MacOSX10.13.sdk.tar.xz | tar -Jxf -; export COREAUDIO_SDK_PATH="$PWD/MacOSX10.13.sdk"; fi -- cargo build --verbose --target=x86_64-apple-darwin -- if [ "$TRAVIS_OS_NAME" = osx ]; then cargo test --verbose; fi From 0d524226c0e174b35e41e1f54737f123967b50fe Mon Sep 17 00:00:00 2001 From: mitchmindtree Date: Wed, 24 Jun 2020 19:04:09 +0200 Subject: [PATCH 4/7] Update status badge to point to CI action status --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2b6557c..060543d 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# coreaudio-sys [![Build Status](https://travis-ci.org/RustAudio/coreaudio-sys.svg?branch=master)](https://travis-ci.org/RustAudio/coreaudio-sys) [![Crates.io](https://img.shields.io/crates/v/coreaudio-sys.svg)](https://crates.io/crates/coreaudio-sys) [![Crates.io](https://img.shields.io/crates/l/coreaudio-sys.svg)](https://github.com/RustAudio/coreaudio-sys/blob/master/LICENSE) +# coreaudio-sys [![Actions Status](https://github.com/rustaudio/coreaudio-sys/workflows/coreaudio-sys/badge.svg)](https://github.com/rustaudio/coreaudio-sys/actions) [![Crates.io](https://img.shields.io/crates/v/coreaudio-sys.svg)](https://crates.io/crates/coreaudio-sys) [![Crates.io](https://img.shields.io/crates/l/coreaudio-sys.svg)](https://github.com/RustAudio/coreaudio-sys/blob/master/LICENSE) Raw bindings to Apple's Core Audio API for macos and iOS generated using [rust-bindgen](https://github.com/rust-lang-nursery/rust-bindgen). [coreaudio-rs](https://github.com/RustAudio/coreaudio-rs) is an attempt at offering a higher level API around this crate. From 0f60f34e73795daef75f6e9a1df631855b5aabbd Mon Sep 17 00:00:00 2001 From: mitchmindtree Date: Thu, 25 Jun 2020 09:50:57 +0200 Subject: [PATCH 5/7] Fix no-default-features build --- build.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.rs b/build.rs index fc328f1..3a7a80e 100644 --- a/build.rs +++ b/build.rs @@ -37,7 +37,7 @@ fn build(sdk_path: Option<&str>, target: &str) { use std::env; use std::path::PathBuf; - let mut headers = vec![]; + let mut headers: Vec<&'static str> = vec![]; #[cfg(feature = "audio_toolbox")] { From f97abf7adf56444a37d7afb04b30d76b18e9121b Mon Sep 17 00:00:00 2001 From: mitchmindtree Date: Thu, 25 Jun 2020 09:59:01 +0200 Subject: [PATCH 6/7] Move docs check into separate action --- .github/workflows/coreaudio-sys.yml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/.github/workflows/coreaudio-sys.yml b/.github/workflows/coreaudio-sys.yml index 32f3a64..a288696 100644 --- a/.github/workflows/coreaudio-sys.yml +++ b/.github/workflows/coreaudio-sys.yml @@ -2,7 +2,6 @@ name: coreaudio-sys on: [push, pull_request] jobs: # Run cargo test with default, no and all features. - # Also build the docs with all features to make sure docs.rs will work. macos-test: runs-on: macOS-latest steps: @@ -21,6 +20,20 @@ jobs: 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 From 37a11980a65df5647433526196df728b7a34bb4e Mon Sep 17 00:00:00 2001 From: mitchmindtree Date: Thu, 25 Jun 2020 11:08:22 +0200 Subject: [PATCH 7/7] Temporarily remove cross-compile check action --- .github/workflows/coreaudio-sys.yml | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/.github/workflows/coreaudio-sys.yml b/.github/workflows/coreaudio-sys.yml index a288696..aecdee2 100644 --- a/.github/workflows/coreaudio-sys.yml +++ b/.github/workflows/coreaudio-sys.yml @@ -37,28 +37,6 @@ jobs: - name: cargo doc - all features run: cargo doc --all-features --verbose - # Check that cross-compilation from linux is working. - # TODO: This is adapted from old travis file, should probably also: - # - Check more feature permutations. - # - Use more recent SDK? Looks like 10.13 is used atm. - # - Check iOS target? - linux-cross-compile: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Install stable - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: stable - override: true - - name: Add apple target - run: rustup target add x86_64-apple-darwin - - name: Download SDK - run: curl -sL https://github.com/phracker/MacOSX-SDKs/releases/download/10.13/MacOSX10.13.sdk.tar.xz | tar -Jxf -; export COREAUDIO_SDK_PATH="$PWD/MacOSX10.13.sdk" - - name: Cargo build - run: cargo build --verbose --target=x86_64-apple-darwin - # Publish a new version when pushing to master. # Will succeed if the version has been updated, otherwise silently fails. cargo-publish: