Skip to content

Commit 453a797

Browse files
authored
Merge pull request #26 from lynnswap:codex/pr-21-integration
Add tagged release pipeline and finalize release install docs
2 parents c0c73a5 + 384d2c1 commit 453a797

6 files changed

Lines changed: 423 additions & 0 deletions

File tree

.github/workflows/release.yml

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
8+
jobs:
9+
test:
10+
name: Test
11+
runs-on: macos-15
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v4
15+
16+
- name: Setup Swift 6.2
17+
uses: swift-actions/setup-swift@v2
18+
with:
19+
swift-version: "6.2"
20+
21+
- name: Run tests
22+
run: swift test -Xswiftc -strict-concurrency=minimal
23+
24+
build-arm64:
25+
name: Build (arm64)
26+
needs: test
27+
runs-on: macos-15
28+
steps:
29+
- name: Checkout
30+
uses: actions/checkout@v4
31+
32+
- name: Setup Swift 6.2
33+
uses: swift-actions/setup-swift@v2
34+
with:
35+
swift-version: "6.2"
36+
37+
- name: Build release binaries
38+
run: scripts/build-release.sh --arch arm64 --version "${GITHUB_REF_NAME}" --dist-root dist
39+
40+
- name: Upload arm64 artifacts
41+
uses: actions/upload-artifact@v4
42+
with:
43+
name: dist-arm64
44+
path: dist/arm64
45+
if-no-files-found: error
46+
47+
build-x86_64:
48+
name: Build (x86_64)
49+
needs: test
50+
runs-on: macos-15
51+
steps:
52+
- name: Checkout
53+
uses: actions/checkout@v4
54+
55+
- name: Setup Swift 6.2
56+
uses: swift-actions/setup-swift@v2
57+
with:
58+
swift-version: "6.2"
59+
60+
- name: Build release binaries
61+
run: scripts/build-release.sh --arch x86_64 --version "${GITHUB_REF_NAME}" --dist-root dist
62+
63+
- name: Upload x86_64 artifacts
64+
uses: actions/upload-artifact@v4
65+
with:
66+
name: dist-x86_64
67+
path: dist/x86_64
68+
if-no-files-found: error
69+
70+
release:
71+
name: Package and Publish
72+
needs:
73+
- build-arm64
74+
- build-x86_64
75+
runs-on: macos-15
76+
permissions:
77+
contents: write
78+
steps:
79+
- name: Checkout
80+
uses: actions/checkout@v4
81+
82+
- name: Setup Swift 6.2
83+
uses: swift-actions/setup-swift@v2
84+
with:
85+
swift-version: "6.2"
86+
87+
- name: Download arm64 artifacts
88+
uses: actions/download-artifact@v4
89+
with:
90+
name: dist-arm64
91+
path: dist/arm64
92+
93+
- name: Download x86_64 artifacts
94+
uses: actions/download-artifact@v4
95+
with:
96+
name: dist-x86_64
97+
path: dist/x86_64
98+
99+
- name: Package release archives
100+
run: scripts/package-universal.sh --dist-root dist --output-dir release
101+
102+
- name: Publish GitHub Release
103+
uses: softprops/action-gh-release@v2
104+
with:
105+
files: |
106+
release/*.tar.gz
107+
release/SHA256SUMS.txt
108+
generate_release_notes: true

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,5 @@ DerivedData/
77
.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata
88
.netrc
99
.codex/tmp/
10+
/dist
11+
/release

README.ja.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,34 @@ Xcode のダイアログが、プロキシ起動時に一度だけ表示され
2323
swift run -c release xcode-mcp-proxy-install
2424
```
2525

26+
### GitHub Releases からインストール
27+
28+
各リリースタグ(`v*`)では、次のファイルを公開します:
29+
30+
- `xcode-mcp-proxy.tar.gz`(universal binary)
31+
- `xcode-mcp-proxy-darwin-arm64.tar.gz`
32+
- `xcode-mcp-proxy-darwin-x86_64.tar.gz`
33+
- `SHA256SUMS.txt`
34+
35+
例:
36+
37+
```bash
38+
VERSION=v0.1.0
39+
BASE_URL="https://github.com/lynnswap/XcodeMCPKit/releases/download/${VERSION}"
40+
41+
ARCHIVE="xcode-mcp-proxy.tar.gz" # または: xcode-mcp-proxy-darwin-arm64.tar.gz / xcode-mcp-proxy-darwin-x86_64.tar.gz
42+
curl -fL -O "${BASE_URL}/${ARCHIVE}"
43+
curl -fL -O "${BASE_URL}/SHA256SUMS.txt"
44+
grep " ${ARCHIVE}\$" SHA256SUMS.txt | shasum -a 256 -c
45+
46+
tar -xzf "${ARCHIVE}"
47+
mkdir -p "${HOME}/.local/bin"
48+
cp bin/* "${HOME}/.local/bin/"
49+
chmod +x "${HOME}/.local/bin/xcode-mcp-proxy" \
50+
"${HOME}/.local/bin/xcode-mcp-proxy-server" \
51+
"${HOME}/.local/bin/xcode-mcp-proxy-install"
52+
```
53+
2654
`xcrun mcpbridge` を削除して、用途に応じて以下のいずれかを登録します:
2755

2856
### Codex

README.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,34 @@ See [Architecture](Docs/architecture.md) for the process overview.
2323
swift run -c release xcode-mcp-proxy-install
2424
```
2525

26+
### Install from GitHub Releases
27+
28+
Each release tag (`v*`) publishes:
29+
30+
- `xcode-mcp-proxy.tar.gz` (universal binary)
31+
- `xcode-mcp-proxy-darwin-arm64.tar.gz`
32+
- `xcode-mcp-proxy-darwin-x86_64.tar.gz`
33+
- `SHA256SUMS.txt`
34+
35+
Example:
36+
37+
```bash
38+
VERSION=v0.1.0
39+
BASE_URL="https://github.com/lynnswap/XcodeMCPKit/releases/download/${VERSION}"
40+
41+
ARCHIVE="xcode-mcp-proxy.tar.gz" # or: xcode-mcp-proxy-darwin-arm64.tar.gz / xcode-mcp-proxy-darwin-x86_64.tar.gz
42+
curl -fL -O "${BASE_URL}/${ARCHIVE}"
43+
curl -fL -O "${BASE_URL}/SHA256SUMS.txt"
44+
grep " ${ARCHIVE}\$" SHA256SUMS.txt | shasum -a 256 -c
45+
46+
tar -xzf "${ARCHIVE}"
47+
mkdir -p "${HOME}/.local/bin"
48+
cp bin/* "${HOME}/.local/bin/"
49+
chmod +x "${HOME}/.local/bin/xcode-mcp-proxy" \
50+
"${HOME}/.local/bin/xcode-mcp-proxy-server" \
51+
"${HOME}/.local/bin/xcode-mcp-proxy-install"
52+
```
53+
2654
Replace `xcrun mcpbridge` with one of the following:
2755

2856
### Codex

scripts/build-release.sh

Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
4+
usage() {
5+
cat <<'EOF'
6+
Usage: scripts/build-release.sh --arch <arm64|x86_64> --version <tag> [--dist-root <dir>]
7+
8+
Builds release binaries and stages them under:
9+
<dist-root>/<arch>/bin/
10+
EOF
11+
}
12+
13+
arch=""
14+
version=""
15+
dist_root="dist"
16+
17+
while [[ $# -gt 0 ]]; do
18+
case "$1" in
19+
--arch)
20+
arch="${2:-}"
21+
shift 2
22+
;;
23+
--version)
24+
version="${2:-}"
25+
shift 2
26+
;;
27+
--dist-root)
28+
dist_root="${2:-}"
29+
shift 2
30+
;;
31+
-h|--help)
32+
usage
33+
exit 0
34+
;;
35+
*)
36+
echo "Unknown argument: $1" >&2
37+
usage
38+
exit 1
39+
;;
40+
esac
41+
done
42+
43+
if [[ -z "$arch" ]]; then
44+
echo "--arch is required." >&2
45+
usage
46+
exit 1
47+
fi
48+
49+
if [[ -z "$version" ]]; then
50+
echo "--version is required." >&2
51+
usage
52+
exit 1
53+
fi
54+
55+
case "$arch" in
56+
arm64|x86_64) ;;
57+
*)
58+
echo "Unsupported arch: $arch (expected arm64 or x86_64)" >&2
59+
exit 1
60+
;;
61+
esac
62+
63+
repo_root="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
64+
if [[ "$dist_root" = /* ]]; then
65+
dist_base="$dist_root"
66+
else
67+
dist_base="$repo_root/$dist_root"
68+
fi
69+
70+
out_dir="$dist_base/$arch"
71+
bin_out="$out_dir/bin"
72+
products=(
73+
"xcode-mcp-proxy"
74+
"xcode-mcp-proxy-server"
75+
"xcode-mcp-proxy-install"
76+
)
77+
78+
pushd "$repo_root" >/dev/null
79+
80+
for product in "${products[@]}"; do
81+
swift build -c release \
82+
-Xswiftc -strict-concurrency=minimal \
83+
--arch "$arch" \
84+
--product "$product"
85+
done
86+
87+
bin_path="$(swift build -c release --arch "$arch" --show-bin-path)"
88+
rm -rf "$out_dir"
89+
mkdir -p "$bin_out"
90+
91+
for product in "${products[@]}"; do
92+
source_path="$bin_path/$product"
93+
if [[ ! -f "$source_path" ]]; then
94+
source_path="$(find "$repo_root/.build" -type f -path "*/release/$product" | head -n 1 || true)"
95+
fi
96+
if [[ -z "$source_path" || ! -f "$source_path" ]]; then
97+
echo "Failed to locate built binary: $product" >&2
98+
exit 1
99+
fi
100+
101+
target_path="$bin_out/$product"
102+
cp "$source_path" "$target_path"
103+
chmod +x "$target_path"
104+
if command -v codesign >/dev/null 2>&1; then
105+
codesign --remove-signature "$target_path" >/dev/null 2>&1 || true
106+
fi
107+
done
108+
109+
cat > "$out_dir/manifest.txt" <<EOF
110+
version=$version
111+
arch=$arch
112+
built_at=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
113+
EOF
114+
115+
popd >/dev/null
116+
117+
echo "Staged release binaries at: $out_dir"

0 commit comments

Comments
 (0)