esearchstat 1.0.0-rc.1

A high-performance desktop GUI for incredibly fast text searching, powered by ripgrep.
Documentation
name: Upload Release Binary

on:
  release:
    types: [published]

permissions:
  contents: write

jobs:
  build-linux-windows:
    name: Build & Upload Linux/Windows (${{ matrix.target }})
    runs-on: ubuntu-latest

    container:
      image: registry.gitlab.com/xangelix-pub/containers/arch-rust-nightly-pin-common:latest
      options: --user root # How I wish this was GitLab

    strategy:
      fail-fast: false
      matrix:
        include:
          - target: x86_64-unknown-linux-gnu
            asset_name: esearchstat-linux-x86_64
            binary_path: target/release/esearchstat
            setup_cmd: echo "Using native target architecture."
            build_cmd: cargo build --release

          - target: x86_64-pc-windows-gnu
            asset_name: esearchstat-windows-x86_64.exe
            binary_path: target/x86_64-pc-windows-gnu/release/esearchstat.exe
            setup_cmd: |
              paru -Syu --noconfirm mingw-w64
              rustup target add x86_64-pc-windows-gnu
            build_cmd: cargo build --release --target x86_64-pc-windows-gnu

    steps:
      - name: Checkout Source Code
        uses: actions/checkout@v6

      - name: Cache dependencies
        uses: swatinem/rust-cache@v2
        with:
          key: ${{ matrix.target }}

      - name: Install Target Dependencies
        run: ${{ matrix.setup_cmd }}

      - name: Compile optimized release binary
        run: ${{ matrix.build_cmd }}

      - name: Stage Release Asset
        run: |
          mkdir -p staging
          cp ${{ matrix.binary_path }} staging/${{ matrix.asset_name }}

      - name: Upload Asset to GitHub Release
        uses: softprops/action-gh-release@v3
        with:
          files: staging/${{ matrix.asset_name }}
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

  build-macos:
    name: Build & Upload macOS (${{ matrix.target }})
    runs-on: macos-latest
    strategy:
      fail-fast: false
      matrix:
        include:
          - target: aarch64-apple-darwin
            asset_name: esearchstat-macos-arm64
            binary_path: target/aarch64-apple-darwin/release/esearchstat
          - target: x86_64-apple-darwin
            asset_name: esearchstat-macos-x86_64
            binary_path: target/x86_64-apple-darwin/release/esearchstat

    steps:
      - name: Checkout Source Code
        uses: actions/checkout@v6

      - name: Install Rust Toolchain
        uses: dtolnay/rust-toolchain@master
        with:
          toolchain: nightly-2026-04-15
          targets: ${{ matrix.target }}

      - name: Cache dependencies
        uses: swatinem/rust-cache@v2
        with:
          key: ${{ matrix.target }}

      - name: Compile optimized release binary
        run: cargo build --release --target ${{ matrix.target }}

      - name: Stage Release Asset
        run: |
          mkdir -p staging
          cp ${{ matrix.binary_path }} staging/${{ matrix.asset_name }}

      - name: Upload Asset to GitHub Release
        uses: softprops/action-gh-release@v3
        with:
          files: staging/${{ matrix.asset_name }}
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}