name: publish

on:
  release:
    types:
      - published

env:
  CARGO_WS_VERSION: "0.2.42"

jobs:
  publish:
    name: publish
    # wait for the cache from all-features
    #  TODO: we really want this:
    # needs: ./.github/workflows/test/platform-matrix
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v4

    - uses: dtolnay/rust-toolchain@stable

    - uses: extractions/setup-just@v2

    - name: cargo install cargo-workspaces
      uses: baptiste0928/cargo-install@v3
      with:
        crate: cargo-workspaces
        version: ${{ env.CARGO_WS_VERSION }}


    - name: just publish
      env:
        CRATES_IO_TOKEN: ${{ secrets.CRATES_IO_TOKEN }}
      run: just publish
