aprender-verify-ml 0.31.2

Synthetic Data Factory for Domain-Specific Code Intelligence
Documentation
name: Nightly Binary Release

on:
  schedule:
    - cron: '0 4 * * *'
  workflow_dispatch:

permissions:
  contents: write

env:
  CARGO_TERM_COLOR: always

jobs:
  build:
    name: Build ${{ matrix.target }}
    runs-on: ${{ matrix.runner }}
    strategy:
      fail-fast: false
      matrix:
        include:
          - target: x86_64-unknown-linux-gnu
            runner: ubuntu-latest
            binary: verificar
            artifact: verificar-x86_64-linux
            use_cross: true
          - target: x86_64-apple-darwin
            runner: macos-latest
            binary: verificar
            artifact: verificar-x86_64-macos
            use_cross: false
          - target: aarch64-apple-darwin
            runner: macos-latest
            binary: verificar
            artifact: verificar-aarch64-macos
            use_cross: false
          - target: x86_64-pc-windows-msvc
            runner: windows-latest
            binary: verificar.exe
            artifact: verificar-x86_64-windows.exe
            use_cross: false

    steps:
      - uses: actions/checkout@v4

      - name: Install Rust
        uses: dtolnay/rust-toolchain@stable
        with:
          targets: ${{ matrix.target }}

      - name: Ensure target is installed
        run: rustup target add ${{ matrix.target }}

      - name: Install cross
        if: matrix.use_cross
        run: cargo install cross --locked

      - name: Build (cross)
        if: matrix.use_cross
        run: cross build --release --target ${{ matrix.target }}

      - name: Build (native)
        if: "!matrix.use_cross"
        run: cargo build --release --target ${{ matrix.target }}

      - name: Rename binary
        shell: bash
        run: cp target/${{ matrix.target }}/release/${{ matrix.binary }} ${{ matrix.artifact }}

      - name: Upload artifact
        uses: actions/upload-artifact@v4
        with:
          name: ${{ matrix.artifact }}
          path: ${{ matrix.artifact }}

  release:
    name: Publish Nightly Release
    needs: build
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v4

      - name: Download all artifacts
        uses: actions/download-artifact@v4
        with:
          path: artifacts/

      - name: Prepare release assets
        run: |
          mkdir -p release/
          find artifacts/ -type f | while read f; do
            cp "$f" release/
          done
          ls -lh release/

      - name: Delete existing nightly tag
        run: gh release delete nightly --cleanup-tag -y || true
        env:
          GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

      - name: Create nightly release
        uses: softprops/action-gh-release@v2
        with:
          tag_name: nightly
          name: "Nightly Build (${{ github.sha }})"
          body: |
            Automated nightly build from `main` branch.
            Commit: ${{ github.sha }}
            Date: ${{ github.event.head_commit.timestamp || github.event.repository.updated_at }}
          prerelease: true
          files: release/*
          make_latest: false