deloxide 1.1.0

Deloxide scrubs your threads clean by detecting deadlocks in real time—keeping your system smooth, safe, and corrosion-free. 🦀🧼🔒
Documentation
name: Release

on:
  push:
    tags: ["v*"]
  workflow_dispatch:
    inputs:
      tag:
        description: Tag to validate without publishing
        required: true

permissions:
  contents: read

jobs:
  validate:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
        with:
          fetch-depth: 0
      - uses: dtolnay/rust-toolchain@4cda84d5c5c54efe2404f9d843567869ab1699d4
        with:
          toolchain: "1.90.0"
          components: rustfmt, clippy
      - uses: peaceiris/actions-mdbook@948b432f0fddb61de0806565a7222b36e12e2ee3 # v2.0.0
        with:
          mdbook-version: "0.5.4"
      - run: scripts/validate_release.sh "${{ github.event.inputs.tag || github.ref_name }}"

  c-artifacts:
    needs: validate
    strategy:
      matrix:
        include:
          - os: ubuntu-latest
            library: libdeloxide.a
          - os: macos-latest
            library: libdeloxide.a
          - os: windows-latest
            library: deloxide.lib
    runs-on: ${{ matrix.os }}
    steps:
      - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
      - uses: dtolnay/rust-toolchain@4cda84d5c5c54efe2404f9d843567869ab1699d4
        with:
          toolchain: "1.90.0"
      - run: cargo build --release
      - name: Package C library
        shell: bash
        run: |
          package="deloxide-${GITHUB_REF_NAME}-${RUNNER_OS}"
          mkdir -p "dist/${package}/include" "dist/${package}/lib"
          cp include/deloxide.h "dist/${package}/include/"
          cp "target/release/${{ matrix.library }}" "dist/${package}/lib/"
          cp LICENSE-MIT LICENSE-APACHE README.md "dist/${package}/"
          tar -C dist -czf "dist/${package}.tar.gz" "${package}"
          openssl dgst -sha256 "dist/${package}.tar.gz" > "dist/${package}.tar.gz.sha256"
      - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
        with:
          name: deloxide-${{ github.ref_name }}-${{ runner.os }}
          path: |
            dist/*.tar.gz
            dist/*.sha256

  publish:
    if: github.event_name == 'push'
    needs: [validate, c-artifacts]
    runs-on: ubuntu-latest
    environment: crates-io
    permissions:
      contents: read
    steps:
      - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
      - uses: dtolnay/rust-toolchain@4cda84d5c5c54efe2404f9d843567869ab1699d4
        with:
          toolchain: "1.90.0"
      - run: cargo publish --token "${{ secrets.CARGO_REGISTRY_TOKEN }}"

  github-release:
    if: github.event_name == 'push'
    needs: publish
    runs-on: ubuntu-latest
    permissions:
      contents: write
    steps:
      - uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
        with:
          path: artifacts
      - run: gh release create "$GITHUB_REF_NAME" artifacts/**/* --generate-notes
        env:
          GH_TOKEN: ${{ github.token }}