dumpspace-api 2.0.1

Compile-time offset resolution for Spuckwaffel's Dumpspace.
Documentation
on:
  workflow_dispatch


name: Publish

jobs:
  audit:
    name: Audit
    runs-on: ubuntu-latest
    timeout-minutes: 10
    steps:
      - uses: actions/checkout@v4
      - name: "Generate Cargo.lock"
        run: cargo generate-lockfile

      - name: cargo-audit cache restore
        id: cargo-audit_cache_restore
        uses: actions/cache/restore@v4
        with:
          path: ~/.cargo/bin/cargo-audit
          key: ${{ runner.os }}-cargo-audit

      - run: cargo install cargo-audit
        if: steps.cargo-audit_cache_restore.outputs.cache-hit != 'true'

      - name: cargo-audit cache save
        id: cargo-audit_cache_save
        uses: actions/cache/save@v4
        if: always() && steps.cargo-audit_cache_restore.outputs.cache-hit != 'true'
        with:
          path: ~/.cargo/bin/cargo-audit
          key: ${{ runner.os }}-cargo-audit

      - uses: rustsec/audit-check@v2
        with:
          token: ${{ secrets.GITHUB_TOKEN }}

  build_and_test_linux:
    name: Build and Test (Linux)
    runs-on: ubuntu-latest
    timeout-minutes: 10
    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@stable

      - uses: taiki-e/install-action@nextest
      - name: "Build and test"
        run: cargo nextest run --workspace --all-features

  build_and_test_windows:
    name: Build and Test (Windows)
    runs-on: windows-latest
    timeout-minutes: 20
    steps:
      - name: Prepare symlink configuration
        run: git config --global core.symlinks true

      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@stable

      - uses: taiki-e/install-action@nextest
      - name: "Build and test"
        run: cargo nextest run --workspace --all-features

  crates_io_publish:
    name: Publish (crates.io)
    needs:
      - audit
      - build_and_test_linux
      - build_and_test_windows

    runs-on: ubuntu-latest
    timeout-minutes: 25
    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@stable

      - name: cargo-release cache restore
        id: cargo_release_cache_restore
        uses: actions/cache/restore@v4
        with:
          path: ~/.cargo/bin/cargo-release
          key: ${{ runner.os }}-cargo-release

      - run: cargo install cargo-release
        if: steps.cargo_release_cache_restore.outputs.cache-hit != 'true'

      - name: cargo-release cache save
        id: cargo_release_cache_save
        uses: actions/cache/save@v4
        if: always() && steps.cargo_release_cache_restore.outputs.cache-hit != 'true'
        with:
          path: ~/.cargo/bin/cargo-release
          key: ${{ runner.os }}-cargo-release

      - name: cargo login
        run: |-
          echo "${{ secrets.CARGO_REGISTRY_TOKEN }}" | cargo login
      - name: "cargo release publish"
        run: |-
          cargo release \
            publish \
            --workspace \
            --all-features \
            --no-confirm \
            --no-verify \
            --execute