Merge pull request #1 from nitrite/copilot/fix-rebuild-index-tests #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*.*.*' | |
| workflow_dispatch: | |
| inputs: | |
| dry_run: | |
| description: 'Dry run (do not actually publish)' | |
| required: false | |
| default: true | |
| type: boolean | |
| env: | |
| CARGO_TERM_COLOR: always | |
| jobs: | |
| publish: | |
| name: Publish Crates | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Cache cargo registry | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/registry | |
| ~/.cargo/git | |
| target | |
| key: ${{ runner.os }}-cargo-publish-${{ hashFiles('**/Cargo.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-cargo-publish- | |
| - name: Verify build | |
| run: cargo build --release --workspace | |
| - name: Run tests | |
| run: cargo test --workspace | |
| # Publish crates in dependency order | |
| - name: Publish nitrite-derive | |
| if: ${{ github.event.inputs.dry_run != 'true' }} | |
| run: cargo publish -p nitrite_derive --token ${{ secrets.CARGO_REGISTRY_TOKEN }} | |
| continue-on-error: true | |
| - name: Wait for crates.io index update | |
| if: ${{ github.event.inputs.dry_run != 'true' }} | |
| run: sleep 30 | |
| - name: Publish nitrite | |
| if: ${{ github.event.inputs.dry_run != 'true' }} | |
| run: cargo publish -p nitrite --token ${{ secrets.CARGO_REGISTRY_TOKEN }} | |
| continue-on-error: true | |
| - name: Wait for crates.io index update | |
| if: ${{ github.event.inputs.dry_run != 'true' }} | |
| run: sleep 30 | |
| - name: Publish nitrite-fjall-adapter | |
| if: ${{ github.event.inputs.dry_run != 'true' }} | |
| run: cargo publish -p nitrite_fjall_adapter --token ${{ secrets.CARGO_REGISTRY_TOKEN }} | |
| continue-on-error: true | |
| - name: Publish nitrite-spatial | |
| if: ${{ github.event.inputs.dry_run != 'true' }} | |
| run: cargo publish -p nitrite_spatial --token ${{ secrets.CARGO_REGISTRY_TOKEN }} | |
| continue-on-error: true | |
| - name: Publish nitrite-tantivy-fts | |
| if: ${{ github.event.inputs.dry_run != 'true' }} | |
| run: cargo publish -p nitrite_tantivy_fts --token ${{ secrets.CARGO_REGISTRY_TOKEN }} | |
| continue-on-error: true | |
| # Dry run mode - just verify packages | |
| - name: Dry run - Verify packages | |
| if: ${{ github.event.inputs.dry_run == 'true' }} | |
| run: | | |
| echo "Dry run mode - verifying packages..." | |
| cargo package -p nitrite_derive --allow-dirty | |
| cargo package -p nitrite --allow-dirty | |
| cargo package -p nitrite_fjall_adapter --allow-dirty | |
| cargo package -p nitrite_spatial --allow-dirty | |
| cargo package -p nitrite_tantivy_fts --allow-dirty | |
| echo "All packages verified successfully!" |