Skip to content

Commit

Permalink
add publish steps to CI workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
hamaluik committed Mar 16, 2023
1 parent c01ae94 commit b339292
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/rust.yml
Expand Up @@ -35,3 +35,33 @@ jobs:
run: cargo fmt --all -- --check
- name: Lint
run: cargo clippy --all-targets -- --deny warnings
publish-check:
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
- name: Fetch
run: cargo fetch
- name: Publish (dry run)
run: cargo publish --dry-run
publish:
if: ${{ startsWith(github.ref, 'refs/tags/') }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
- name: Fetch
run: cargo fetch
- name: Publish
run: cargo publish
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}

0 comments on commit b339292

Please sign in to comment.