name: Test Release on: workflow_dispatch: jobs: build: name: Test Build (${{ matrix.binary }}) runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: include: - os: ubuntu-latest target: bun-linux-x64 binary: hai-linux-x64 - os: macos-latest target: bun-darwin-arm64 binary: hai-darwin-arm64 - os: macos-13 target: bun-darwin-x64 binary: hai-darwin-x64 - os: windows-latest target: bun-windows-x64 binary: hai-windows-x64.exe steps: - name: Checkout uses: actions/checkout@v4 - name: Install pnpm uses: pnpm/action-setup@v4 - name: Setup Node.js uses: actions/setup-node@v4 with: node-version: "22" cache: pnpm - name: Install Bun uses: oven-sh/setup-bun@v2 - name: Install dependencies run: pnpm install - name: Build run: pnpm build - name: Build standalone binary run: pnpm --filter hai build:exe -- --target ${{ matrix.target }} - name: Generate checksum (Linux) if: runner.os == 'Linux' run: | cd packages/cli/dist sha256sum ${{ matrix.binary }} > ${{ matrix.binary }}.sha256 - name: Generate checksum (macOS) if: runner.os == 'macOS' run: | cd packages/cli/dist shasum -a 256 ${{ matrix.binary }} > ${{ matrix.binary }}.sha256 - name: Generate checksum (Windows) if: runner.os == 'Windows' shell: pwsh run: | cd packages/cli/dist $hash = (Get-FileHash -Algorithm SHA256 "${{ matrix.binary }}").Hash.ToLower() "$hash ${{ matrix.binary }}" | Out-File -Encoding ascii "${{ matrix.binary }}.sha256" - name: Smoke test (Unix) if: runner.os != 'Windows' run: | chmod +x packages/cli/dist/${{ matrix.binary }} packages/cli/dist/${{ matrix.binary }} --help - name: Smoke test (Windows) if: runner.os == 'Windows' run: .\packages\cli\dist\${{ matrix.binary }} --help - name: Upload binary artifact uses: actions/upload-artifact@v4 with: name: ${{ matrix.binary }} path: | packages/cli/dist/${{ matrix.binary }} packages/cli/dist/${{ matrix.binary }}.sha256 collect: name: Collect Artifacts needs: build runs-on: ubuntu-latest steps: - name: Download all artifacts uses: actions/download-artifact@v4 with: path: artifacts - name: Upload combined archive uses: actions/upload-artifact@v4 with: name: hai-all-platforms path: artifacts/**/*