diff options
| author | 2025-05-25 03:05:21 +0800 | |
|---|---|---|
| committer | 2025-05-25 10:48:36 +0800 | |
| commit | b9cbeb1dbf33fff6c7b03ef24f0e6a773f58da82 (patch) | |
| tree | 569e8c37024462c8586256041e9072798bb49443 | |
| parent | 532c5e4d7a178472f608d4790a49fc7bff46e6f1 (diff) | |
| download | soon-b9cbeb1dbf33fff6c7b03ef24f0e6a773f58da82.tar.gz soon-b9cbeb1dbf33fff6c7b03ef24f0e6a773f58da82.zip | |
feat: Add GitHub Actions workflow for publishing to crates.io
| -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 |