Skip to content

Commit bc590d3

Browse files
authored
Merge branch 'master' into feat/os-widgets
2 parents 4e75c6a + 0401d3a commit bc590d3

4 files changed

Lines changed: 92 additions & 33 deletions

File tree

.github/workflows/claude-code-review.yml

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,15 @@
11
name: Claude Code Review
22

33
on:
4-
pull_request:
5-
types: [opened, synchronize, reopened, ready_for_review]
6-
# Optional: Only run on specific file changes
7-
# paths:
8-
# - "src/**/*.ts"
9-
# - "src/**/*.tsx"
10-
# - "src/**/*.js"
11-
# - "src/**/*.jsx"
4+
workflow_dispatch:
5+
inputs:
6+
pr_number:
7+
description: "Pull request number to review"
8+
required: true
9+
type: number
1210

1311
concurrency:
14-
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
12+
group: ${{ github.workflow }}-${{ inputs.pr_number }}
1513
cancel-in-progress: true
1614

1715
jobs:
@@ -40,7 +38,7 @@ jobs:
4038
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4139
run: |
4240
REPO="${{ github.repository }}"
43-
PR_NUMBER="${{ github.event.pull_request.number }}"
41+
PR_NUMBER="${{ inputs.pr_number }}"
4442
4543
# Minimize issue comments from claude[bot]
4644
gh api "repos/$REPO/issues/$PR_NUMBER/comments" --jq '.[] | select(.user.login == "claude[bot]") | .node_id' | while read -r node_id; do
@@ -62,9 +60,8 @@ jobs:
6260
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
6361
plugin_marketplaces: 'https://github.com/anthropics/claude-code.git'
6462
plugins: 'code-review@claude-code-plugins'
65-
prompt: '/code-review:code-review --comment ${{ github.repository }}/pull/${{ github.event.pull_request.number }}'
63+
prompt: '/code-review:code-review --comment ${{ github.repository }}/pull/${{ inputs.pr_number }}'
6664
claude_args: |
6765
--allowedTools "Bash(gh pr comment:*),Bash(gh pr diff:*),Bash(gh pr view:*),Bash(gh api:*),Bash(git log:*),Bash(git diff:*),Bash(git blame:*),Read,Glob,Grep"
6866
# See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md
6967
# or https://code.claude.com/docs/en/cli-reference for available options
70-

.github/workflows/claude.yml

Lines changed: 7 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,15 @@
11
name: Claude Code
22

33
on:
4-
issue_comment:
5-
types: [created]
6-
pull_request_review_comment:
7-
types: [created]
8-
issues:
9-
types: [opened, assigned]
10-
pull_request_review:
11-
types: [submitted]
4+
workflow_dispatch:
5+
inputs:
6+
prompt:
7+
description: "Prompt for Claude Code"
8+
required: true
9+
type: string
1210

1311
jobs:
1412
claude:
15-
# Only allow trusted actors (OWNER, MEMBER, COLLABORATOR) to trigger Claude with write permissions
16-
if: |
17-
(github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude') &&
18-
contains(fromJSON('["OWNER", "MEMBER", "COLLABORATOR"]'), github.event.comment.author_association)) ||
19-
(github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude') &&
20-
contains(fromJSON('["OWNER", "MEMBER", "COLLABORATOR"]'), github.event.comment.author_association)) ||
21-
(github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude') &&
22-
contains(fromJSON('["OWNER", "MEMBER", "COLLABORATOR"]'), github.event.review.author_association)) ||
23-
(github.event_name == 'issues' && (contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude')) &&
24-
contains(fromJSON('["OWNER", "MEMBER", "COLLABORATOR"]'), github.event.issue.author_association))
2513
runs-on: ubuntu-latest
2614
permissions:
2715
contents: write # Allow creating branches/commits
@@ -45,8 +33,7 @@ jobs:
4533
additional_permissions: |
4634
actions: read
4735
48-
# Optional: Give a custom prompt to Claude. If this is not specified, Claude will perform the instructions specified in the comment that tagged it.
49-
# prompt: 'Update the pull request description to include a summary of changes.'
36+
prompt: ${{ inputs.prompt }}
5037

5138
# Optional: Add claude_args to customize behavior and configuration
5239
# See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md

Bitkit.xcodeproj/xcshareddata/xcschemes/Bitkit.xcscheme

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
</Testables>
6969
</TestAction>
7070
<LaunchAction
71-
buildConfiguration = "Release"
71+
buildConfiguration = "Debug"
7272
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
7373
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
7474
launchStyle = "0"

run.sh

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
#!/usr/bin/env bash
2+
3+
set -euo pipefail
4+
5+
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
6+
DERIVED_DATA_PATH="$ROOT_DIR/build"
7+
APP_PATH="$DERIVED_DATA_PATH/Build/Products/Debug-iphoneos/Bitkit.app"
8+
BUNDLE_ID="to.bitkit"
9+
10+
DEVICE_LIST_DIR="$(mktemp -d "${TMPDIR:-/tmp}/bitkit-devices.XXXXXX")"
11+
DEVICE_LIST_JSON="$DEVICE_LIST_DIR/devices.json"
12+
trap 'rm -rf "$DEVICE_LIST_DIR"' EXIT
13+
14+
if ! command -v python3 >/dev/null 2>&1; then
15+
echo "python3 is required to parse the devicectl device list." >&2
16+
exit 1
17+
fi
18+
19+
echo "Looking for connected iPhones..."
20+
xcrun devicectl list devices \
21+
--filter "hardwareProperties.deviceType == 'iPhone' AND hardwareProperties.reality == 'physical'" \
22+
--timeout 10 \
23+
--json-output "$DEVICE_LIST_JSON" >/dev/null
24+
25+
if ! DEVICE_INFO="$(
26+
python3 - "$DEVICE_LIST_JSON" <<'PY'
27+
import json
28+
import sys
29+
30+
with open(sys.argv[1], "r", encoding="utf-8") as file:
31+
payload = json.load(file)
32+
33+
devices = payload.get("result", {}).get("devices", [])
34+
35+
if not devices:
36+
raise SystemExit(1)
37+
38+
device = devices[0]
39+
name = device.get("deviceProperties", {}).get("name", "Unknown iPhone")
40+
identifier = device.get("identifier")
41+
42+
if not identifier:
43+
raise SystemExit(1)
44+
45+
print(f"{identifier}\t{name}")
46+
PY
47+
)"; then
48+
echo "No connected physical iPhone found." >&2
49+
exit 1
50+
fi
51+
52+
DEVICE_ID="${DEVICE_INFO%%$'\t'*}"
53+
DEVICE_NAME="${DEVICE_INFO#*$'\t'}"
54+
55+
echo "Using $DEVICE_NAME ($DEVICE_ID)"
56+
echo "Building Debug app..."
57+
xcodebuild \
58+
-project "$ROOT_DIR/Bitkit.xcodeproj" \
59+
-scheme Bitkit \
60+
-configuration Debug \
61+
-destination "generic/platform=iOS" \
62+
-derivedDataPath "$DERIVED_DATA_PATH" \
63+
build
64+
65+
LDK_STUB_PATH="$APP_PATH/Frameworks/LDKNodeFFI.framework"
66+
if [[ -d "$LDK_STUB_PATH" ]]; then
67+
echo "Removing LDKNodeFFI static framework stub..."
68+
rm -rf "$LDK_STUB_PATH"
69+
fi
70+
71+
echo "Installing $APP_PATH..."
72+
xcrun devicectl device install app --device "$DEVICE_ID" "$APP_PATH"
73+
74+
echo "Launching $BUNDLE_ID..."
75+
xcrun devicectl device process launch --device "$DEVICE_ID" "$BUNDLE_ID" --terminate-existing --console

0 commit comments

Comments
 (0)