Added DonkeyBreed
#17
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Rust CI and Publish | |
on: | |
workflow_dispatch: | |
pull_request: | |
branches: | |
- main | |
- master | |
paths: | |
- '**/*.rs' | |
- 'Cargo.toml' | |
- 'Cargo.lock' | |
push: | |
branches: | |
- main | |
paths: | |
- '**/*.rs' | |
- 'Cargo.toml' | |
- 'Cargo.lock' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Set up Rust | |
uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: stable | |
- name: Install dependencies and run tests | |
run: | | |
cargo check | |
cargo test | |
publish: | |
runs-on: ubuntu-latest | |
needs: build | |
if: github.ref == 'refs/heads/main' # Only run on push to `main` | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Set up Rust | |
uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: stable | |
- name: Publish to crates.io | |
run: | | |
cargo login ${{ secrets.CARGO_TOKEN }} # Login to crates.io | |
cargo publish --no-verify # Publish the crate |