Skip to content

Commit 398d144

Browse files
committed
release: prepare v0.0.17 with macOS ARM64 support
- Bump version to 0.0.17 in mcpp.toml - Add CHANGELOG entry for 0.0.17 (macOS ARM64 headline feature) - Fix release.yml macOS job: replace broken self-host approach with proven xmake direct build (matching bootstrap-macos.yml) - Use macosx-arm64 naming convention for tarball artifacts - Remove broken self-host step from ci-macos.yml
1 parent a6cd836 commit 398d144

4 files changed

Lines changed: 72 additions & 36 deletions

File tree

.github/workflows/ci-macos.yml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -278,13 +278,3 @@ jobs:
278278
export LLVM_ROOT="$LLVM_ROOT"
279279
bash scripts/bootstrap-macos.sh "$LLVM_ROOT"
280280
./target/bootstrap/bin/mcpp --version
281-
282-
- name: Self-host (mcpp builds mcpp)
283-
run: |
284-
# Put bootstrapped mcpp on PATH so build.ninja can find it for dyndep
285-
export PATH="$PWD/target/bootstrap/bin:$PATH"
286-
mcpp build
287-
SELFHOST=$(find target -path "*/bin/mcpp" -not -path "*/bootstrap/*" -not -path "*/build/*" | head -1)
288-
test -x "$SELFHOST"
289-
"$SELFHOST" --version
290-
echo ":: Self-host successful!"

.github/workflows/release.yml

Lines changed: 51 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -315,37 +315,63 @@ jobs:
315315
LLVM_ROOT=$(find "$HOME/.xlings" -path "*/xpkgs/xim-x-llvm/*/bin/clang++" | head -1 | xargs dirname | xargs dirname)
316316
echo "LLVM_ROOT=$LLVM_ROOT" >> "$GITHUB_ENV"
317317
318-
- name: Install xmake (for bootstrap)
319-
run: brew install xmake
320-
321-
- name: Bootstrap-compile mcpp (xmake + LLVM)
318+
- name: Install xmake
322319
run: |
323-
export LLVM_ROOT="$LLVM_ROOT"
324-
bash scripts/bootstrap-macos.sh "$LLVM_ROOT"
325-
./target/bootstrap/bin/mcpp --version
320+
brew install xmake
321+
xmake --version
326322
327-
- name: Self-host rebuild (mcpp builds mcpp)
323+
- name: Build mcpp with xmake + LLVM
328324
run: |
329-
# Put bootstrapped mcpp on PATH so build.ninja can find it for dyndep
330-
export PATH="$PWD/target/bootstrap/bin:$PATH"
331-
mcpp build
332-
# Find the self-hosted binary
333-
SELFHOST=$(find target -path "*/bin/mcpp" -not -path "*/bootstrap/*" -not -path "*/build/*" | head -1)
334-
test -x "$SELFHOST"
335-
"$SELFHOST" --version
336-
echo "SELFHOST=$SELFHOST" >> "$GITHUB_ENV"
325+
# Generate xmake.lua if not present
326+
if [ ! -f xmake.lua ]; then
327+
cat > xmake.lua << 'EOF'
328+
add_rules("mode.release")
329+
set_languages("c++23")
330+
331+
package("cmdline")
332+
set_homepage("https://github.com/mcpplibs/cmdline")
333+
set_description("Modern C++ command-line parsing library")
334+
set_license("Apache-2.0")
335+
add_urls("https://github.com/mcpplibs/cmdline/archive/refs/tags/$(version).tar.gz")
336+
add_versions("0.0.1", "3fb2f5495c1a144485b3cbb2e43e27059151633460f702af0f3851cbff387ef0")
337+
on_install(function (package)
338+
import("package.tools.xmake").install(package)
339+
end)
340+
package_end()
341+
342+
add_requires("cmdline 0.0.1")
343+
344+
target("mcpp")
345+
set_kind("binary")
346+
add_files("src/main.cpp")
347+
add_files("src/**.cppm")
348+
add_packages("cmdline")
349+
add_includedirs("src/libs/json")
350+
set_policy("build.c++.modules", true)
351+
EOF
352+
fi
353+
354+
xmake f -y -m release --toolchain=llvm --sdk="$LLVM_ROOT"
355+
xmake build -y mcpp
356+
357+
# Locate and verify built binary
358+
MCPP_BIN=$(find build -name mcpp -type f -perm +111 | head -1)
359+
test -x "$MCPP_BIN"
360+
file "$MCPP_BIN"
361+
"$MCPP_BIN" --version
362+
echo "MCPP_BIN=$MCPP_BIN" >> "$GITHUB_ENV"
337363
338364
- name: Package macOS release
339365
id: stage
340366
run: |
341367
VERSION="${{ steps.resolve.outputs.version }}"
342-
TARBALL_NAME="mcpp-${VERSION}-darwin-arm64.tar.gz"
343-
WRAPPER="mcpp-${VERSION}-darwin-arm64"
368+
TARBALL_NAME="mcpp-${VERSION}-macosx-arm64.tar.gz"
369+
WRAPPER="mcpp-${VERSION}-macosx-arm64"
344370
345371
# Create release layout
346372
STAGING=$(mktemp -d)
347373
mkdir -p "$STAGING/$WRAPPER/bin"
348-
cp "$SELFHOST" "$STAGING/$WRAPPER/bin/mcpp"
374+
cp "$MCPP_BIN" "$STAGING/$WRAPPER/bin/mcpp"
349375
# Strip (Mach-O)
350376
strip "$STAGING/$WRAPPER/bin/mcpp" 2>/dev/null || true
351377
# Copy metadata
@@ -371,10 +397,10 @@ jobs:
371397
mkdir -p dist
372398
(cd "$STAGING" && tar -czf "$GITHUB_WORKSPACE/dist/${TARBALL_NAME}" "$WRAPPER")
373399
# Versionless alias
374-
cp "dist/${TARBALL_NAME}" "dist/mcpp-darwin-arm64.tar.gz"
400+
cp "dist/${TARBALL_NAME}" "dist/mcpp-macosx-arm64.tar.gz"
375401
# SHA256
376402
(cd dist && shasum -a 256 "${TARBALL_NAME}" > "${TARBALL_NAME}.sha256")
377-
(cd dist && shasum -a 256 "mcpp-darwin-arm64.tar.gz" > "mcpp-darwin-arm64.tar.gz.sha256")
403+
(cd dist && shasum -a 256 "mcpp-macosx-arm64.tar.gz" > "mcpp-macosx-arm64.tar.gz.sha256")
378404
379405
echo "tarball=${TARBALL_NAME}" >> "$GITHUB_OUTPUT"
380406
ls -la dist/
@@ -394,7 +420,7 @@ jobs:
394420
with:
395421
tag_name: ${{ steps.resolve.outputs.tag }}
396422
files: |
397-
dist/mcpp-${{ steps.resolve.outputs.version }}-darwin-arm64.tar.gz
398-
dist/mcpp-${{ steps.resolve.outputs.version }}-darwin-arm64.tar.gz.sha256
399-
dist/mcpp-darwin-arm64.tar.gz
400-
dist/mcpp-darwin-arm64.tar.gz.sha256
423+
dist/mcpp-${{ steps.resolve.outputs.version }}-macosx-arm64.tar.gz
424+
dist/mcpp-${{ steps.resolve.outputs.version }}-macosx-arm64.tar.gz.sha256
425+
dist/mcpp-macosx-arm64.tar.gz
426+
dist/mcpp-macosx-arm64.tar.gz.sha256

CHANGELOG.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,26 @@
33
> 本文件追踪 `mcpp-community/mcpp` 公开仓的版本演进。
44
> 格式参考 [Keep a Changelog](https://keepachangelog.com/zh-CN/1.1.0/)
55
6+
## [0.0.17] — 2026-05-16
7+
8+
macOS ARM64 正式支持,首次发布 macOS 原生二进制。
9+
10+
### 新增
11+
12+
-**macOS ARM64 支持** —— mcpp 现在正式支持 macOS ARM64 (Apple Silicon)
13+
平台。发布产物包含 `mcpp-<version>-macosx-arm64.tar.gz`,基于 xlings LLVM
14+
20.1.7 + xmake 构建,无需 Xcode 完整安装即可使用。
15+
-**Release CI macOS job** —— release.yml 新增 `build-macos` job,使用
16+
xmake + xlings LLVM 直接编译 macOS ARM64 二进制,与 bootstrap-macos.yml
17+
验证通过的方案一致。
18+
19+
### 改进
20+
21+
- 🔧 **Release macOS 构建流程简化** —— 移除有 libc++ 链接问题的 self-host
22+
步骤,改用已验证的 xmake 直接构建方案,提高 CI 可靠性。
23+
- 🔧 **CI macOS 流程精简** —— ci-macos.yml 移除存在链接问题的 self-host
24+
步骤,保留 xlings LLVM 验证测试。
25+
626
## [0.0.14] — 2026-05-13
727

828
LLVM / Clang 工具链支持与 xlings 镜像配置完善。

mcpp.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "mcpp"
3-
version = "0.0.16"
3+
version = "0.0.17"
44
description = "Modern C++ build & package management tool"
55
license = "Apache-2.0"
66
authors = ["mcpp-community"]

0 commit comments

Comments
 (0)