fix: support primary and foreign keys #16
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: | |
| - "[0-9]+.[0-9]+.[0-9]+" | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| - name: Verify tag matches Cargo.toml version | |
| run: | | |
| CARGO_VERSION=$(grep '^version' crates/sqlx_gen/Cargo.toml | head -1 | sed 's/.*"\(.*\)".*/\1/') | |
| TAG_VERSION=${GITHUB_REF#refs/tags/} | |
| if [ "$CARGO_VERSION" != "$TAG_VERSION" ]; then | |
| echo "Tag $TAG_VERSION does not match Cargo.toml version $CARGO_VERSION" | |
| exit 1 | |
| fi | |
| - name: Publish sqlx-gen-macros | |
| run: cargo publish --token ${{ secrets.CARGO_REGISTRY_TOKEN }} --package sqlx-gen-macros | |
| - name: Wait for crates.io index update | |
| run: sleep 30 | |
| - name: Publish sqlx-gen | |
| run: cargo publish --token ${{ secrets.CARGO_REGISTRY_TOKEN }} --package sqlx-gen |