Skip to content

fix(tests): make docker command ExitStatusExt portable #2

fix(tests): make docker command ExitStatusExt portable

fix(tests): make docker command ExitStatusExt portable #2

name: Release Dry Run
on:
pull_request:
workflow_dispatch:
permissions:
contents: read
jobs:
build:
name: dry-run build (${{ matrix.target }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
bin: target/release/loopforge
- os: macos-15-intel
target: x86_64-apple-darwin
bin: target/release/loopforge
- os: macos-14
target: aarch64-apple-darwin
bin: target/release/loopforge
- os: windows-latest
target: x86_64-pc-windows-msvc
bin: target/release/loopforge.exe
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.x"
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Rust cache
uses: Swatinem/rust-cache@v2
- name: Build (release)
run: cargo build --release -p loopforge-cli --locked --features bedrock
- name: Package (dry run)
run: python scripts/package_release.py --version "dryrun-${{ github.run_id }}" --target "${{ matrix.target }}" --bin "${{ matrix.bin }}" --out-dir dist
- name: Smoke test packaged binary (Unix)
if: runner.os != 'Windows'
shell: bash
run: |
set -euo pipefail
version="dryrun-${{ github.run_id }}"
base="loopforge-${version}-${{ matrix.target }}"
archive="dist/${base}.tar.gz"
rm -rf smoke
mkdir -p smoke
tar -xzf "${archive}" -C smoke
bin="smoke/${base}/loopforge"
"${bin}" --help >/dev/null
doctor_json="$("${bin}" doctor --json --timeout-ms 200)"
printf '%s' "${doctor_json}" | python3 -c "import json,sys; data=json.load(sys.stdin); assert 'summary' in data and 'checks' in data"
- name: Smoke test packaged binary (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: |
$version = "dryrun-${{ github.run_id }}"
$base = "loopforge-$version-${{ matrix.target }}"
$archive = "dist/$base.zip"
if (!(Test-Path $archive)) { throw "missing archive: $archive" }
Remove-Item -Recurse -Force smoke -ErrorAction SilentlyContinue
Expand-Archive -Path $archive -DestinationPath smoke -Force
$bin = "smoke/$base/loopforge.exe"
& $bin --help | Out-Null
$doctor = & $bin doctor --json --timeout-ms 200
$parsed = $doctor | ConvertFrom-Json
if ($null -eq $parsed.summary -or $null -eq $parsed.checks) {
throw "doctor json missing summary/checks"
}
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: dry-run-dist-${{ matrix.target }}
path: |
dist/*.tar.gz
dist/*.zip
dist/*.sha256
if-no-files-found: error