44 push :
55 branches : [main]
66 pull_request :
7- branches : [main]
8-
9- env :
10- XLINGS_VERSION : v0.4.0
117
128jobs :
13- build-linux :
14- runs-on : ubuntu-24.04
9+ build-linux-mcpp :
10+ name : build (linux x86_64, mcpp)
11+ runs-on : ubuntu-latest
1512 steps :
16- - name : Checkout code
17- uses : actions/checkout@v4
18-
19- - name : Install system deps
20- run : |
21- sudo apt-get update -qq
22- sudo apt-get install -y curl git build-essential
13+ - uses : actions/checkout@v4
2314
24- - name : Install Xlings
15+ - name : Install xlings
2516 env :
26- XLINGS_NON_INTERACTIVE : 1
17+ XLINGS_VERSION : 0.4.31
2718 run : |
28- VERSION_NUM="${XLINGS_VERSION#v}"
29- TARBALL="xlings-${VERSION_NUM}-linux-x86_64.tar.gz"
30- curl -fSL -o "$RUNNER_TEMP/$TARBALL" "https://github.com/d2learn/xlings/releases/download/${XLINGS_VERSION}/${TARBALL}"
31- tar -xzf "$RUNNER_TEMP/$TARBALL" -C "$RUNNER_TEMP"
32- EXTRACT_DIR=$(find "$RUNNER_TEMP" -maxdepth 1 -type d -name "xlings-*" | head -1)
33- chmod +x "$EXTRACT_DIR/bin/xlings"
34- "$EXTRACT_DIR/bin/xlings" self install
35- echo "PATH=$HOME/.xlings/subos/current/bin:$PATH" >> "$GITHUB_ENV"
19+ tarball="xlings-${XLINGS_VERSION}-linux-x86_64.tar.gz"
20+ curl -fsSL -o "/tmp/${tarball}" \
21+ "https://github.com/d2learn/xlings/releases/download/v${XLINGS_VERSION}/${tarball}"
22+ tar -xzf "/tmp/${tarball}" -C /tmp
23+ "/tmp/xlings-${XLINGS_VERSION}-linux-x86_64/subos/default/bin/xlings" self install
24+ echo "$HOME/.xlings/subos/current/bin" >> "$GITHUB_PATH"
3625
37- - name : Install Project Dependencies via Xlings
38- run : |
39- xlings install
26+ - name : Refresh package index
27+ run : xlings update
4028
29+ - name : Install workspace tools (.xlings.json → mcpp 0.0.13)
30+ run : xlings install -y
4131
42- - name : Build with xmake
43- run : |
44- xmake f -m release -vv -y
45- xmake -j$(nproc)
32+ - name : Cache mcpp sandbox
33+ uses : actions/cache@v4
34+ with :
35+ path : ~/.xlings/data/xpkgs/xim-x-mcpp/0.0.13/registry
36+ key : mcpp-sandbox-${{ runner.os }}-mcpp0.0.13
37+
38+ - name : Build with mcpp
39+ run : mcpp build
4640
4741 - name : Verify d2x
4842 run : |
49- ./build/linux/x86_64/release/d2x --version
50- ./build/linux/x86_64/release/d2x new hello
43+ binary=$(find target -name d2x -type f | head -1)
44+ test -n "$binary" || { echo "d2x binary not found"; find target -type f | head -20; exit 1; }
45+ chmod +x "$binary"
46+ "$binary" --version
5147
5248 build-macos :
5349 runs-on : macos-15
@@ -58,10 +54,10 @@ jobs:
5854 - name : Install Xlings
5955 env :
6056 XLINGS_NON_INTERACTIVE : 1
57+ XLINGS_VERSION : 0.4.31
6158 run : |
62- VERSION_NUM="${XLINGS_VERSION#v}"
63- TARBALL="xlings-${VERSION_NUM}-macosx-arm64.tar.gz"
64- curl -fSL -o "$RUNNER_TEMP/$TARBALL" "https://github.com/d2learn/xlings/releases/download/${XLINGS_VERSION}/${TARBALL}"
59+ TARBALL="xlings-${XLINGS_VERSION}-macosx-arm64.tar.gz"
60+ curl -fSL -o "$RUNNER_TEMP/$TARBALL" "https://github.com/d2learn/xlings/releases/download/v${XLINGS_VERSION}/${TARBALL}"
6561 tar -xzf "$RUNNER_TEMP/$TARBALL" -C "$RUNNER_TEMP"
6662 EXTRACT_DIR=$(find "$RUNNER_TEMP" -maxdepth 1 -type d -name "xlings-*" | head -1)
6763 xattr -dr com.apple.quarantine "$EXTRACT_DIR" 2>/dev/null || true
@@ -74,16 +70,20 @@ jobs:
7470 xlings install
7571 clang --version
7672
73+ - name : Configure xmake
74+ run : |
75+ LLVM_ROOT="$HOME/.xlings/data/xpkgs/xim-x-llvm"
76+ LLVM_SDK=$(find "$LLVM_ROOT" -mindepth 1 -maxdepth 1 -type d | sort -V | tail -1)
77+ test -d "$LLVM_SDK"
78+ "$LLVM_SDK/bin/clang++" --version
79+ xmake f -m release --toolchain=llvm --sdk="$LLVM_SDK" -y -vvD
7780
7881 - name : Build with xmake
79- run : |
80- xmake f -m release --toolchain=llvm -vv -y
81- xmake -j$(nproc)
82+ run : xmake -a -j"$(sysctl -n hw.logicalcpu)"
8283
8384 - name : Verify d2x
8485 run : |
8586 ./build/macosx/arm64/release/d2x --version
86- ./build/macosx/arm64/release/d2x new hello
8787
8888 build-windows :
8989 runs-on : windows-latest
@@ -104,4 +104,3 @@ jobs:
104104 - name : Verify d2x
105105 run : |
106106 build\windows\x64\release\d2x.exe --version
107- build\windows\x64\release\d2x.exe new hello
0 commit comments