diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 576d00e..29e638b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -34,3 +34,15 @@ jobs: # forwards to it, which is what a dependent crate gets. - name: Clippy (`azo` on its own) run: cargo clippy --package azo --all-targets --all-features -- -D warnings + + publish-dry-run: + runs-on: windows-latest + steps: + - uses: actions/checkout@v5 + + - uses: dtolnay/rust-toolchain@stable + + # `--workspace` verifies `azo` against the locally packaged `azo-sys`, + # rather than the version already on crates.io. + - name: Publish dry-run + run: cargo publish --dry-run --workspace diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..76b16ce --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,25 @@ +on: + push: + tags: + - 'v[0-9]+.[0-9]+.[0-9]+' + +name: Publish on crates.io + +jobs: + publish: + name: Publish + # ASIO is Windows-only, and `cargo publish` builds the crate to verify it + runs-on: windows-latest + steps: + - name: Checkout sources + uses: actions/checkout@v5 + + - name: Install toolchain + uses: dtolnay/rust-toolchain@stable + + # `--workspace` publishes `azo-sys` first and waits for it to show up on the + # index before publishing `azo`, which depends on it. + - name: Publish crates + env: + CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} + run: cargo publish --workspace