From 3edec9333ecfcd9d3ace29839f923bdb23b5a854 Mon Sep 17 00:00:00 2001 From: Charles Saracco Date: Tue, 17 Nov 2020 14:15:54 -0500 Subject: [PATCH] Reformat the github workflows config, add crates.io deploy stage (#146) --- .github/workflows/deploy.yml | 32 ++++++++++++++++++++++++++++++ .github/workflows/docs.yml | 38 ++++++++++++++++++++++++++++++++++++ .github/workflows/rust.yml | 19 ++++++++++++++---- Cargo.toml | 1 - README.md | 8 ++++---- 5 files changed, 89 insertions(+), 9 deletions(-) create mode 100644 .github/workflows/deploy.yml create mode 100644 .github/workflows/docs.yml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 00000000..b309d1ea --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,32 @@ +name: Deploy + +on: + release: + types: [created] + +jobs: + build: + steps: + - uses: actions/checkout@v2 + + # Installs the latest stable rust, and all components needed for the rest of the CI pipeline. + - name: Set up CI environment + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + override: true + + # Sanity check: make sure the release builds + - name: Build + run: cargo build --verbose + + # Sanity check: make sure all tests in the release pass + - name: Test + run: cargo test --verbose + + # Deploy to crates.io + # Only works on github releases (tagged commits) + - name: Deploy to crates.io + env: + CRATESIO_ENCRYPTED_TOKEN: ${{ secrets.CRATESIO_ENCRYPTED_TOKEN }} + run: cargo publish --token $CRATESIO_ENCRYPTED_TOKEN --manifest-path Cargo.toml \ No newline at end of file diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 00000000..cf79c276 --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,38 @@ +name: Docs + +on: + push: + branches: + - master + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + # Installs the latest stable rust, and all components needed for the rest of the CI pipeline. + - name: Set up CI environment + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + override: true + + # Sanity check: make sure the release builds + - name: Build + run: cargo build --verbose + + # Sanity check: make sure all tests in the release pass + - name: Test + run: cargo test --verbose + + # Generate docs and push to documentation branch + - name: Generate docs + env: + GH_ENCRYPTED_TOKEN: ${{ secrets.GH_ENCRYPTED_TOKEN }} + run: | + cargo doc --all --no-deps + echo '' > target/doc/index.html + sudo pip install ghp-import + ghp-import -n target/doc + git push -fq https://${GH_ENCRYPTED_TOKEN}@github.com/${GITHUB_REPOSITORY}.git gh-pages \ No newline at end of file diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index c28a983a..a453c48b 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -11,17 +11,28 @@ jobs: steps: - uses: actions/checkout@v2 - - name: Install latest stable rust + + # Installs the latest stable rust, and all components needed for the rest of the CI pipeline. + - name: Set up CI environment uses: actions-rs/toolchain@v1 with: toolchain: stable override: true components: rustfmt, clippy + + # Makes sure the code builds successfully. - name: Build run: cargo build --verbose - - name: Run tests + + # Makes sure all of the tests pass. + - name: Test run: cargo test --verbose -# - name: Clippy -# run: cargo clippy --all-targets --all-features -- -D warnings -A clippy::unreadable_literal -A clippy::needless_range_loop -A clippy::float_cmp -A clippy::comparison-chain -A clippy::needless-doctest-main -A clippy::missing-safety-doc + + # Runs Clippy on the codebase, and makes sure there are no lint warnings. + # Disabled for now. Re-enable if you find it useful enough to deal with it constantly breaking. + # - name: Clippy + # run: cargo clippy --all-targets --all-features -- -D warnings -A clippy::unreadable_literal -A clippy::needless_range_loop -A clippy::float_cmp -A clippy::comparison-chain -A clippy::needless-doctest-main -A clippy::missing-safety-doc + + # Makes sure the codebase is up to `cargo fmt` standards - name: Format check run: cargo fmt --all -- --check \ No newline at end of file diff --git a/Cargo.toml b/Cargo.toml index a0395acc..036ae168 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -23,7 +23,6 @@ description = "VST 2.4 API implementation in rust. Create plugins or hosts." readme = "README.md" repository = "https://github.com/rustaudio/vst-rs" -documentation = "https://rustaudio.github.io/vst-rs/vst/" license = "MIT" keywords = ["vst", "vst2", "plugin"] diff --git a/README.md b/README.md index 42f2dff3..7fca878b 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,4 @@ # vst-rs -[![Travis Build][trav-img]][trav-url] [![crates.io][crates-img]][crates-url] [![dependency status](https://deps.rs/repo/github/rustaudio/vst-rs/status.svg)](https://deps.rs/repo/github/rustaudio/vst-rs) [![Discord Chat][discord-img]][discord-url] @@ -16,7 +15,10 @@ your plugin code to be compatible with the new, thread-safe plugin API. See the to port your plugin. ## Library Documentation - - https://rustaudio.github.io/vst-rs/vst/ + +Documentation for **released** versions can be found [here](https://docs.rs/vst/). + +Development documentation (current `master` branch) can be found [here](https://rustaudio.github.io/vst-rs/vst/). ## Crate This crate is available on [crates.io](https://crates.io/crates/vst). If you prefer the bleeding-edge, you can also @@ -81,8 +83,6 @@ name = "basicvst" crate-type = ["cdylib"] ``` -[trav-img]: https://travis-ci.org/rustaudio/vst-rs.svg?branch=master -[trav-url]: https://travis-ci.org/rustaudio/vst-rs [crates-img]: https://img.shields.io/crates/v/vst.svg [crates-url]: https://crates.io/crates/vst [discord-img]: https://img.shields.io/discord/590254806208217089.svg?label=Discord&logo=discord&color=blue