diff options
| -rw-r--r-- | .github/workflows/publish-crates.yml | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/.github/workflows/publish-crates.yml b/.github/workflows/publish-crates.yml new file mode 100644 index 0000000..96f1007 --- /dev/null +++ b/.github/workflows/publish-crates.yml @@ -0,0 +1,35 @@ +name: Publish to crates.io +on: + push: + branches: + - main + - master + tags: + - '*' + pull_request: + workflow_dispatch: + +permissions: + contents: read + +jobs: + publish: + name: Publish crate + runs-on: ubuntu-latest + if: startsWith(github.ref, 'refs/tags/v') + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Install Rust toolchain + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + override: true + + - name: Publish to crates.io + env: + CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} + run: | + cargo publish --no-verify |