Skip to content

Fix: GitHub Workflow trigger #3

Fix: GitHub Workflow trigger

Fix: GitHub Workflow trigger #3

name: publish crates
on:
push:
pull_request:
release:
# "released" events are emitted either when directly be released or be edited from pre-released.
types: [prereleased, released]
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- run: cargo build --release --all-features
- name: publish (dry-run)
if: github.event_name == 'release' && github.event.release.prerelease
run: cargo publish --dry-run --allow-dirty
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
- name: publish
if: github.event_name == 'release' && !github.event.release.prerelease
run: cargo publish --allow-dirty
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}