Update release.yml

This commit is contained in:
reallynniroprobably
2026-03-17 00:12:25 +11:00
parent f7661ecb20
commit c2747f5538

View File

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