Skip to content

Commit aa3dc4e

Browse files
refactor: move macOS code to platforms/macos (#84)
* refactor: move macOS code to platforms/macos - Move all Swift/SwiftUI source code to platforms/macos/ - Update CI workflows to use working-directory for macOS builds - Update paths in .gitignore for new structure - Add Rust target/ to .gitignore This establishes a cleaner monorepo structure: - platforms/macos/ - Swift/SwiftUI macOS app - platforms/windows/ - .NET Windows app Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * refactor: update release workflow to use PlistBuddy for versioning and move appcast.xml to root --------- Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 81a1bdc commit aa3dc4e

File tree

115 files changed

+72
-22
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

115 files changed

+72
-22
lines changed

.github/workflows/ci.yml

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,24 @@ on:
44
push:
55
branches: [main]
66
paths:
7-
- 'Sources/**'
8-
- 'Tests/**'
9-
- 'Package.swift'
7+
- 'platforms/macos/**'
108
- '.github/workflows/ci.yml'
119
tags-ignore:
1210
- 'v*'
1311
pull_request:
1412
branches: [main]
1513
paths:
16-
- 'Sources/**'
17-
- 'Tests/**'
18-
- 'Package.swift'
14+
- 'platforms/macos/**'
1915
- '.github/workflows/ci.yml'
2016

2117
concurrency:
2218
group: ${{ github.workflow }}-${{ github.ref }}
2319
cancel-in-progress: true
2420

21+
defaults:
22+
run:
23+
working-directory: platforms/macos
24+
2525
jobs:
2626
build:
2727
name: Build & Test
@@ -40,9 +40,9 @@ jobs:
4040
uses: actions/cache@v4
4141
with:
4242
path: |
43-
.build
43+
platforms/macos/.build
4444
~/Library/Caches/org.swift.swiftpm
45-
key: ${{ runner.os }}-spm-${{ hashFiles('Package.resolved') }}
45+
key: ${{ runner.os }}-spm-${{ hashFiles('platforms/macos/Package.resolved') }}
4646
restore-keys: |
4747
${{ runner.os }}-spm-
4848
@@ -74,7 +74,7 @@ jobs:
7474
[ -f "$APP/Contents/MacOS/PortKiller" ] || { echo "Missing executable"; exit 1; }
7575
[ -f "$APP/Contents/Info.plist" ] || { echo "Missing Info.plist"; exit 1; }
7676
[ -d "$APP/Contents/Frameworks/Sparkle.framework" ] || { echo "Missing Sparkle framework"; exit 1; }
77-
77+
7878
# Verify SPM resource bundles in Contents/Resources
7979
[ -d "$APP/Contents/Resources/KeyboardShortcuts_KeyboardShortcuts.bundle" ] || { echo "Missing KeyboardShortcuts bundle"; exit 1; }
8080
[ -d "$APP/Contents/Resources/Defaults_Defaults.bundle" ] || { echo "Missing Defaults bundle"; exit 1; }
@@ -101,17 +101,20 @@ jobs:
101101
xcode-version: latest-stable
102102

103103
- name: Validate Package.swift
104+
working-directory: platforms/macos
104105
run: |
105106
echo "Validating Package.swift..."
106107
swift package describe > /dev/null
107108
echo "✓ Package structure is valid"
108109
109110
- name: Check dependencies
111+
working-directory: platforms/macos
110112
run: |
111113
echo "Dependencies:"
112114
swift package show-dependencies --format flatlist
113115
114116
- name: Check for TODO/FIXME comments
117+
working-directory: platforms/macos
115118
run: |
116119
echo "Checking for TODO/FIXME comments..."
117120
TODOS=$(grep -rn "TODO\|FIXME" Sources/ --include="*.swift" || true)
@@ -123,6 +126,7 @@ jobs:
123126
fi
124127
125128
- name: Check file line counts
129+
working-directory: platforms/macos
126130
run: |
127131
echo "Checking for files over 300 lines..."
128132
FOUND=0
@@ -139,6 +143,7 @@ jobs:
139143
fi
140144
141145
- name: Verify documentation headers
146+
working-directory: platforms/macos
142147
run: |
143148
echo "Checking for documentation headers..."
144149
MISSING=""
@@ -157,6 +162,7 @@ jobs:
157162
fi
158163
159164
- name: Check for print statements
165+
working-directory: platforms/macos
160166
run: |
161167
echo "Checking for debug print statements..."
162168
PRINTS=$(grep -rn "print(" Sources/ --include="*.swift" | grep -v "// DEBUG" || true)
@@ -165,4 +171,4 @@ jobs:
165171
echo "$PRINTS" | head -10
166172
else
167173
echo "✓ No print statements found"
168-
fi
174+
fi

.github/workflows/release.yml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,10 @@ jobs:
7070
if: ${{ always() && (needs.create-release.result == 'success' || needs.create-release.result == 'skipped') }}
7171
runs-on: macos-latest
7272

73+
defaults:
74+
run:
75+
working-directory: platforms/macos
76+
7377
steps:
7478
- name: Checkout code
7579
uses: actions/checkout@v4
@@ -106,8 +110,7 @@ jobs:
106110
VERSION="${RELEASE_VERSION#v}" # Remove 'v' prefix (v1.2.4 -> 1.2.4)
107111
BUILD_NUMBER=$(git rev-list --count HEAD)
108112
109-
# Update CFBundleShortVersionString
110-
sed -i '' "s/<string>.*<\/string><!--VERSION-->/<string>${VERSION}<\/string><!--VERSION-->/" Resources/Info.plist
113+
# Update version strings using PlistBuddy
111114
/usr/libexec/PlistBuddy -c "Set :CFBundleShortVersionString ${VERSION}" Resources/Info.plist
112115
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion ${BUILD_NUMBER}" Resources/Info.plist
113116
@@ -267,6 +270,7 @@ jobs:
267270
268271
- name: Upload DMG to Release
269272
if: ${{ !inputs.dry_run && !inputs.is_pr_build }}
273+
working-directory: platforms/macos
270274
run: |
271275
gh release upload ${{ env.RELEASE_VERSION }} "$DMG_NAME" --clobber
272276
env:
@@ -277,7 +281,7 @@ jobs:
277281
uses: actions/upload-artifact@v4
278282
with:
279283
name: PortKiller-PR${{ inputs.pr_number }}
280-
path: ${{ env.DMG_NAME }}
284+
path: platforms/macos/${{ env.DMG_NAME }}
281285
retention-days: 7
282286

283287
- name: Dry run summary
@@ -336,10 +340,13 @@ jobs:
336340
337341
- name: Commit appcast.xml
338342
if: ${{ !inputs.dry_run && !inputs.is_pr_build }}
343+
working-directory: ${{ github.workspace }}
339344
run: |
340345
git config user.name "github-actions[bot]"
341346
git config user.email "github-actions[bot]@users.noreply.github.com"
342347
git checkout main
348+
# Move appcast.xml to root level (SUFeedURL points to main/appcast.xml)
349+
mv platforms/macos/appcast.xml appcast.xml
343350
git add appcast.xml
344351
git commit -m "chore: update appcast.xml for ${RELEASE_VERSION}" || echo "No changes to commit"
345352
git push origin main

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,4 +60,7 @@ bun.lockb
6060
*.suo
6161
*.userprefs
6262
.vs/
63-
*.DotSettings.user
63+
*.DotSettings.user
64+
65+
# Rust
66+
**/target/

CONTRIBUTING.md

Lines changed: 42 additions & 8 deletions
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)