chore: Update CD #2
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: CD | |
on: | |
push: | |
branches: [ master ] | |
tags: | |
- "v*" | |
pull_request: | |
branches: | |
- master | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
rust: | |
- stable | |
- beta | |
- nightly | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Install Rust toolchain | |
run: rustup update ${{ matrix.toolchain }} && rustup default ${{ matrix.toolchain }} && rustup component add clippy rustfmt | |
- name: Build | |
run: cargo build --verbose | |
- name: Test | |
run: cargo test --no-fail-fast --verbose | |
- name: Format check | |
run: cargo fmt --all --check --verbose --message-format=human | |
- name: Clippy | |
run: cargo clippy -- -D warnings | |
- name: Publish dry-run | |
run: cargo publish --dry-run | |
publish: | |
needs: test | |
if: startsWith(github.ref, 'refs/tags/v') | |
runs-on: ubuntu-latest | |
steps: | |
- name: Install Rust toolchain | |
run: rustup update stable && rustup default stable | |
- name: Publish | |
run: cargo publish --package dota-gsi --verbose |