name: release on: push: branches: - main pull_request: concurrency: group: release-${{ github.ref }} cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} jobs: release: permissions: id-token: write runs-on: ubuntu-latest environment: ${{ github.ref == 'refs/heads/main' && 'release' || '' }} steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: submodules: true - uses: swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2.9.2 - run: cargo install cargo-workspaces - uses: rust-lang/crates-io-auth-action@c6f97d42243bad5fab37ca0427f495c86d5b1a18 # v1.0.5 id: auth if: github.ref == 'refs/heads/main' - run: > cargo workspaces publish -y --from-git --no-verify ${{ github.ref != 'refs/heads/main' && '--dry-run' || '' }} env: CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }}