chore: fix publish error #65
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: CI | |
on: | |
push: | |
branches: | |
- master | |
tags: | |
- v*.*.* | |
pull_request: | |
branches: | |
- master | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
lint: | |
strategy: | |
fail-fast: false | |
matrix: | |
host: | |
- macos-latest | |
- windows-latest | |
- ubuntu-latest | |
name: Lint on ${{ matrix.host }} | |
runs-on: ${{ matrix.host }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install rust toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
override: true | |
components: rustfmt, clippy | |
- name: Cargo fmt | |
run: cargo fmt -- --check | |
- name: Clippy | |
run: cargo clippy | |
- name: Test | |
run: cargo test | |
publish: | |
name: Publish | |
runs-on: ubuntu-latest | |
if: ${{ github.event_name == 'push' && github.ref_type == 'tag' && startsWith(github.ref_name, 'v') }} | |
needs: | |
- lint | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install rust toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
override: true | |
components: rustfmt, clippy | |
- name: Check semver | |
uses: obi1kenobi/cargo-semver-checks-action@v2 | |
- name: Publish | |
env: | |
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} | |
run: -| | |
cargo clean | |
cargo publish | |
- name: Release drafter | |
uses: release-drafter/release-drafter@v5 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
publish: true | |
name: ${{ github.ref_name }} | |
tag: ${{ github.ref_name }} |