unicorn-engine-sys 2.1.5

Rust bindings for the Unicorn emulator with utility functions
Documentation
name: Crate 📦 Distribution

concurrency:
  group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
  cancel-in-progress: true

on:
  push:
    paths-ignore:
      - ".gitignore"
      - "docs/**"
      - "README"
      - "CREDITS.TXT"
      - "COPYING_GLIB"
      - "COPYING.LGPL2"
      - "AUTHORS.TXT"
      - "CHANGELOG"
      - "COPYING"
  pull_request:

env:
  UNICORN_VERSION: dev

jobs:
  build:
    runs-on: ${{ matrix.config.os }}
    name: ${{ matrix.config.name }}
    strategy:
      fail-fast: false
      matrix:
        config:
          - { os: windows-2022, arch: x64, name: "Windows x86_64" }
          - { os: windows-2022, arch: x86, name: "Windows x86" }
          - { os: ubuntu-latest, arch: x64, name: "Ubuntu x86_64" }
          - { os: macos-latest, arch: x64, name: "macOS x86_64" }
    steps:
      - uses: actions/checkout@v4

      - name: Set up Rust
        uses: actions-rust-lang/setup-rust-toolchain@v1

      - name: "🛠️ Activate Developer Command Prompt"
        if: contains(matrix.config.os, 'win')
        uses: ilammy/msvc-dev-cmd@v1
        with:
          arch: ${{ matrix.config.arch }}

      - name: "🛠️ Win build dependencies"
        if: contains(matrix.config.os, 'win')
        shell: bash
        run: |
          choco install ninja

      - name: "🚧 Cargo test"
        if: "!startsWith(github.ref, 'refs/tags')"
        run: |
          cargo test

      - name: Publish crates to Crates.io
        if: startsWith(github.ref, 'refs/tags') && !startsWith(github.ref, 'refs/tags/v') && contains(matrix.config.os, 'ubuntu')
        uses: katyo/publish-crates@v2
        with:
          registry-token: ${{ secrets.cratesio_token }}