44 push :
55 branches : [ "main" ]
66 tags :
7- - ' v*' # Triggers automatic release when pushing tags like v0.1.0
7+ - ' v*'
88 pull_request :
99 branches : [ "main" ]
1010
1111permissions :
1212 contents : write
1313
1414jobs :
15- # ---------------------------------------------------------------------------
16- # Job 1: Build & Verify across Windows, Linux, and macOS Matrix
17- # ---------------------------------------------------------------------------
1815 build :
1916 name : Build (${{ matrix.os }})
2017 runs-on : ${{ matrix.os }}
@@ -24,13 +21,10 @@ jobs:
2421 include :
2522 - os : windows-latest
2623 artifact_name : xary-windows-x64.exe
27- binary_path : build/Release/xary.exe
2824 - os : ubuntu-latest
2925 artifact_name : xary-linux-x64
30- binary_path : build/xary
3126 - os : macos-latest
3227 artifact_name : xary-macos-x64
33- binary_path : build/xary
3428
3529 steps :
3630 - name : 📥 Checkout Repository
@@ -42,32 +36,37 @@ jobs:
4236 - name : 🔨 Compile Binary
4337 run : cmake --build build --config Release
4438
45- - name : 🧪 Test CLI Binary Output
39+ - name : 🧪 Test CLI Binary Output & Prepare Artifact
4640 shell : bash
4741 run : |
48- if [ "${{ runner.os }}" == "Windows" ]; then
49- ./build/Release/xary.exe --version
50- ./build/Release/xary.exe --help
51- else
52- ./build/xary --version
53- ./build/xary --help
42+ # Dynamically locate the built executable across OS generators
43+ if [ -f "build/Release/xary.exe" ]; then
44+ BIN="build/Release/xary.exe"
45+ elif [ -f "build/xary.exe" ]; then
46+ BIN="build/xary.exe"
47+ elif [ -f "build/Release/xary" ]; then
48+ BIN="build/Release/xary"
49+ elif [ -f "build/xary" ]; then
50+ BIN="build/xary"
5451 fi
5552
56- - name : 📦 Prepare Release Artifact
57- shell : bash
58- run : |
53+ echo "Found binary at: $BIN"
54+ chmod +x "$BIN" 2>/dev/null || true
55+
56+ # Run CLI smoke tests
57+ "$BIN" --version
58+ "$BIN" --help
59+
60+ # Package for upload
5961 mkdir -p dist
60- cp ${{ matrix.binary_path }} dist/${{ matrix.artifact_name }}
62+ cp "$BIN" " dist/${{ matrix.artifact_name }}"
6163
6264 - name : 📤 Upload Build Artifact
6365 uses : actions/upload-artifact@v4
6466 with :
6567 name : ${{ matrix.os }}-build
6668 path : dist/*
6769
68- # ---------------------------------------------------------------------------
69- # Job 2: Automatically Create GitHub Release (Triggered on Version Tags)
70- # ---------------------------------------------------------------------------
7170 release :
7271 name : 🚀 Publish GitHub Release
7372 needs : build
0 commit comments