Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ef89552

Browse files
committed
fix(ci): replace Tuist install with brew and fix Metal duplicate build issue
- Use brew to install Tuist in workflows for consistency - Add script to remove duplicate Shaders.metal entry in SwiftTerm project - Run fix script after project generation in CI workflows - Replace tuist build/test with xcodebuild commands targeting Apple Silicon
1 parent 1cc10b8 commit ef89552

4 files changed

Lines changed: 43 additions & 15 deletions

File tree

.github/workflows/build.yml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,18 @@ jobs:
2525
swift-version: ${{ env.SWIFT_VERSION }}
2626

2727
- name: Install Tuist
28-
run: |
29-
curl -Ls https://github.com/tuist/tuist/releases/download/4.130.2/tuist.zip -o /tmp/tuist.zip
30-
unzip -o /tmp/tuist.zip -d /usr/local/bin/
31-
tuist version
28+
run: brew install --cask tuist
3229

3330
- name: Install Dependencies
3431
run: tuist install
3532

33+
- name: Generate Project
34+
run: |
35+
tuist generate --no-open
36+
./scripts/fix-swiftterm-metal.sh
37+
3638
- name: Build Debug
37-
run: tuist build
39+
run: xcodebuild build -scheme ClaudeBar -workspace ClaudeBar.xcworkspace -destination 'platform=macOS,arch=arm64'
3840

3941
- name: Build Release
40-
run: tuist build ClaudeBar -- -configuration Release
42+
run: xcodebuild build -scheme ClaudeBar -workspace ClaudeBar.xcworkspace -destination 'platform=macOS,arch=arm64' -configuration Release

.github/workflows/release.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,7 @@ jobs:
4848
swift-version: ${{ env.SWIFT_VERSION }}
4949

5050
- name: Install Tuist
51-
run: |
52-
curl -Ls https://github.com/tuist/tuist/releases/download/4.130.2/tuist.zip -o /tmp/tuist.zip
53-
unzip -o /tmp/tuist.zip -d /usr/local/bin/
54-
tuist version
51+
run: brew install tuist
5552

5653
- name: Cache Tuist
5754
uses: actions/cache@v4
@@ -107,6 +104,7 @@ jobs:
107104
- name: Generate Xcode Project
108105
run: |
109106
tuist generate --no-open
107+
./scripts/fix-swiftterm-metal.sh
110108
echo "=== Available schemes ==="
111109
xcodebuild -workspace ClaudeBar.xcworkspace -list
112110

.github/workflows/tests.yml

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,25 @@ jobs:
2020
run: swift --version
2121

2222
- name: Install Tuist
23-
run: |
24-
curl -Ls https://github.com/tuist/tuist/releases/download/4.130.2/tuist.zip -o /tmp/tuist.zip
25-
unzip -o /tmp/tuist.zip -d /usr/local/bin/
26-
tuist version
23+
run: brew install --cask tuist
2724

2825
- name: Install Dependencies
2926
run: tuist install
3027

28+
- name: Generate Project
29+
run: |
30+
tuist generate --no-open
31+
./scripts/fix-swiftterm-metal.sh
32+
3133
- name: Run Tests with Coverage
32-
run: tuist test --result-bundle-path TestResults.xcresult -- -enableCodeCoverage YES -skipMacroValidation
34+
run: |
35+
xcodebuild test \
36+
-scheme ClaudeBar \
37+
-workspace ClaudeBar.xcworkspace \
38+
-destination 'platform=macOS,arch=arm64' \
39+
-enableCodeCoverage YES \
40+
-skipMacroValidation \
41+
-resultBundlePath TestResults.xcresult
3342
3443
- name: Generate Coverage Report
3544
run: |

scripts/fix-swiftterm-metal.sh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/bin/bash
2+
# Workaround for tuist/tuist#9111: Tuist adds .metal files as both Sources and Resources,
3+
# causing "Unexpected duplicate tasks" build errors.
4+
# This removes the duplicate "Shaders.metal in Sources" entry, keeping only Resources.
5+
6+
PBXPROJ="Tuist/.build/tuist-derived/SwiftTerm/SwiftTerm.xcodeproj/project.pbxproj"
7+
8+
if [ ! -f "$PBXPROJ" ]; then
9+
echo "SwiftTerm project not found, skipping"
10+
exit 0
11+
fi
12+
13+
if grep -q "Shaders.metal in Sources" "$PBXPROJ"; then
14+
sed -i.bak '/Shaders\.metal in Sources/d' "$PBXPROJ"
15+
rm -f "${PBXPROJ}.bak"
16+
echo "Fixed: removed duplicate Shaders.metal from Sources build phase"
17+
else
18+
echo "No duplicate Metal entry found, skipping"
19+
fi

0 commit comments

Comments
 (0)