diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1a54817..7f462b5 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -4,12 +4,12 @@ name: Release on: push: tags: - - 'v*' + - "v*" jobs: build: strategy: - fail-fast: false # Don't cancel other matrix jobs if one fails + fail-fast: false matrix: include: - os: ubuntu-latest @@ -33,16 +33,12 @@ jobs: target_name: creep-macos-arm64 runs-on: ${{ matrix.os }} - - # Makes matrix job labels readable in the Actions UI - # e.g. "build (ubuntu-latest, arm64)" instead of a hash name: "Build · ${{ matrix.target_name }}" steps: - name: Checkout code uses: actions/checkout@v4 - # Print exactly what we're building so logs are self-contained - name: Log build target info shell: bash run: | @@ -54,134 +50,81 @@ jobs: echo " Commit : ${{ github.sha }}" echo "================================================" - # ------------------------------------------------------- - # LINUX ARM64 — cross-compile setup - # ------------------------------------------------------- + # Linux ARM64 cross-compiler - name: Install ARM64 cross-compiler (Linux ARM64 only) if: matrix.os == 'ubuntu-latest' && matrix.arch == 'arm64' run: | - echo "→ Installing aarch64 cross-compiler..." - sudo apt-get update 2>&1 | tail -5 + sudo apt-get update sudo apt-get install -y gcc-aarch64-linux-gnu g++-aarch64-linux-gnu - echo "✓ Cross-compiler installed" aarch64-linux-gnu-g++ --version - # ------------------------------------------------------- - # CMAKE CONFIGURE - # ------------------------------------------------------- + # CMake configure - name: Configure (Linux x86_64) if: matrix.os == 'ubuntu-latest' && matrix.arch == 'x86_64' - run: | - echo "→ Configuring for Linux x86_64..." - cmake -B build -DCMAKE_BUILD_TYPE=Release --log-level=WARNING - echo "✓ Configure complete" + run: cmake -B build -DCMAKE_BUILD_TYPE=Release - name: Configure (Linux ARM64) if: matrix.os == 'ubuntu-latest' && matrix.arch == 'arm64' run: | - echo "→ Configuring for Linux ARM64 (cross-compile)..." cmake -B build -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_SYSTEM_NAME=Linux \ -DCMAKE_SYSTEM_PROCESSOR=aarch64 \ -DCMAKE_C_COMPILER=aarch64-linux-gnu-gcc \ - -DCMAKE_CXX_COMPILER=aarch64-linux-gnu-g++ \ - --log-level=WARNING - echo "✓ Configure complete" + -DCMAKE_CXX_COMPILER=aarch64-linux-gnu-g++ - name: Configure (Windows x86_64) if: matrix.os == 'windows-latest' && matrix.arch == 'x86_64' - run: | - echo "→ Configuring for Windows x86_64..." - cmake -B build -DCMAKE_BUILD_TYPE=Release -A x64 --log-level=WARNING - echo "✓ Configure complete" + run: cmake -B build -DCMAKE_BUILD_TYPE=Release -A x64 - name: Configure (Windows ARM64) if: matrix.os == 'windows-latest' && matrix.arch == 'arm64' - run: | - echo "→ Configuring for Windows ARM64..." - cmake -B build -DCMAKE_BUILD_TYPE=Release -A ARM64 --log-level=WARNING - echo "✓ Configure complete" + run: cmake -B build -DCMAKE_BUILD_TYPE=Release -A ARM64 - name: Configure (macOS ARM64) if: matrix.os == 'macos-latest' run: | - echo "→ Configuring for macOS ARM64..." cmake -B build -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_OSX_ARCHITECTURES=arm64 \ - --log-level=WARNING - echo "✓ Configure complete" + -DCMAKE_OSX_ARCHITECTURES=arm64 - # ------------------------------------------------------- - # BUILD - # Verbose flag makes the compiler command visible in logs - # so you can see exactly what flags were used on failure - # ------------------------------------------------------- + # Build - name: Build - run: | - echo "→ Building ${{ matrix.target_name }}..." - cmake --build build --config Release --verbose - echo "✓ Build complete" + run: cmake --build build --config Release --verbose - # ------------------------------------------------------- - # SANITY CHECK - # Confirm the binary actually exists before we try to rename it - # Catches edge cases where CMake reports success but output is missing - # ------------------------------------------------------- + # Verify binary exists (Linux/macOS) - name: Verify binary exists (Linux / macOS) if: runner.os != 'Windows' run: | - if [ ! -f "build/creep" ]; then - echo "✗ ERROR: Expected binary not found at build/creep" - echo " Contents of build/:" - ls -la build/ + BIN=$(find build -maxdepth 4 -type f -name creep | head -n 1) + if [ -z "$BIN" ]; then + echo "✗ ERROR: creep binary not found" + echo "Contents of build/:" + find build -maxdepth 4 -type f exit 1 fi - echo "✓ Binary found: $(ls -lh build/creep)" + echo "✓ Binary found at $BIN" + mv "$BIN" "${{ matrix.target_name }}" + # Verify binary exists (Windows) - name: Verify binary exists (Windows) if: runner.os == 'Windows' shell: pwsh run: | - if (-Not (Test-Path "build/Release/creep.exe")) { - Write-Error "✗ ERROR: Expected binary not found at build/Release/creep.exe" - Write-Host "Contents of build/Release/:" - Get-ChildItem build/Release/ -ErrorAction SilentlyContinue + $bin = Get-ChildItem -Recurse -Filter creep.exe | Select-Object -First 1 + if (-not $bin) { + Write-Error "✗ ERROR: creep.exe not found" + Get-ChildItem -Recurse build exit 1 } - Write-Host "✓ Binary found: $((Get-Item build/Release/creep.exe).Length) bytes" - - # ------------------------------------------------------- - # RENAME & UPLOAD - # ------------------------------------------------------- - - name: Rename binary (Linux / macOS) - if: runner.os != 'Windows' - run: | - mv build/creep ${{ matrix.target_name }} - echo "✓ Renamed to ${{ matrix.target_name }}" - - - name: Rename binary (Windows) - if: runner.os == 'Windows' - run: | - mv build/Release/creep.exe ${{ matrix.target_name }} - echo "✓ Renamed to ${{ matrix.target_name }}" + Write-Host "✓ Binary found at $($bin.FullName)" + Move-Item $bin.FullName "${{ matrix.target_name }}" - name: Upload artifact uses: actions/upload-artifact@v4 with: name: ${{ matrix.target_name }} path: ${{ matrix.target_name }} - if-no-files-found: error # Fail loudly if artifact is missing + if-no-files-found: error - - name: Log success - shell: bash - run: | - echo "================================================" - echo " ✓ ${{ matrix.target_name }} uploaded successfully" - echo "================================================" - - # ------------------------------------------------------- - # RELEASE JOB - # ------------------------------------------------------- release: needs: build runs-on: ubuntu-latest @@ -193,7 +136,6 @@ jobs: with: path: artifacts/ - # Confirm all 5 expected files are present before creating the release - name: Verify all artifacts downloaded run: | echo "→ Checking artifacts..." @@ -214,16 +156,14 @@ jobs: fi done if [ "$MISSING" -gt 0 ]; then - echo "" echo "✗ $MISSING artifact(s) missing — aborting release" exit 1 fi - echo "" echo "✓ All artifacts present" - name: Create GitHub Release uses: softprops/action-gh-release@v2 with: files: artifacts/**/* - fail_on_unmatched_files: true # Error if glob finds nothing - generate_release_notes: true # Auto-generates changelog from commits + fail_on_unmatched_files: true + generate_release_notes: true