Add GitHub Actions workflow for automatic crates.io publishing #1
Workflow file for this run
This file contains hidden or 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: Publish to Crates.io | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| jobs: | |
| publish: | |
| name: Publish Crate | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Publish rustorch-core | |
| run: cargo publish -p rustorch-core --token ${{ secrets.CARGO_REGISTRY_TOKEN }} | |
| - name: Publish rustorch-nn | |
| # Wait a bit for index update | |
| run: | | |
| sleep 30 | |
| cargo publish -p rustorch-nn --token ${{ secrets.CARGO_REGISTRY_TOKEN }} | |
| - name: Publish rustorch-vision | |
| run: | | |
| sleep 10 | |
| cargo publish -p rustorch-vision --token ${{ secrets.CARGO_REGISTRY_TOKEN }} | |
| - name: Publish rustorch-text | |
| run: | | |
| sleep 10 | |
| cargo publish -p rustorch-text --token ${{ secrets.CARGO_REGISTRY_TOKEN }} | |
| - name: Publish rustorch-wasm | |
| run: | | |
| sleep 10 | |
| cargo publish -p rustorch-wasm --token ${{ secrets.CARGO_REGISTRY_TOKEN }} |