Skip to content

Commit 11febcb

Browse files
Gooolersozercan
andauthored
Fix create-dmg steps and verify builds for PRs (#15)
Co-authored-by: Sertaç Özercan <852750+sozercan@users.noreply.github.com>
1 parent 224e4ad commit 11febcb

File tree

2 files changed

+39
-6
lines changed

2 files changed

+39
-6
lines changed

.github/workflows/dev-build.yml

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,13 @@ on:
1313
- "**.xcworkspace/**"
1414
- "Assets.xcassets/**"
1515
- ".github/workflows/dev-build.yml"
16+
pull_request:
17+
paths:
18+
- "**.swift"
19+
- "**.xcodeproj/**"
20+
- "**.xcworkspace/**"
21+
- "Assets.xcassets/**"
22+
- ".github/workflows/dev-build.yml"
1623
workflow_dispatch:
1724

1825
jobs:
@@ -51,11 +58,21 @@ jobs:
5158
5259
- name: Create DMG
5360
run: |
54-
# Find the built app
55-
APP_PATH=$(find ./build/Build/Products/Release -name "*.app" -type d | head -n 1)
61+
APP_NAME="Kaset.app"
62+
BUILD_DIR="./build/Build/Products/Release"
63+
64+
# debug: show what's in the build folder
65+
echo "Contents of $BUILD_DIR:"
66+
ls -la "$BUILD_DIR" || true
67+
68+
# clean previous artifacts
69+
rm -rf dmg_contents kaset-dev.dmg
70+
71+
# find the main app explicitly by name
72+
APP_PATH=$(find "$BUILD_DIR" -type d -name "$APP_NAME" | head -n 1)
5673
5774
if [ -z "$APP_PATH" ]; then
58-
echo "Error: Could not find built app"
75+
echo "Error: Could not find $APP_NAME in $BUILD_DIR"
5976
exit 1
6077
fi
6178
@@ -73,6 +90,7 @@ jobs:
7390
7491
- name: Upload DMG
7592
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v4
93+
if: github.event_name != 'pull_request'
7694
with:
7795
name: kaset-dev-${{ steps.slug.outputs.sha_short }}
7896
path: kaset-dev.dmg

.github/workflows/release.yml

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,21 @@ jobs:
8585

8686
- name: Create DMG
8787
run: |
88-
APP_PATH=$(find ./build/Build/Products/Release -name "*.app" -type d | head -n 1)
88+
APP_NAME="Kaset.app"
89+
BUILD_DIR="./build/Build/Products/Release"
90+
91+
# debug: show what's in the build folder
92+
echo "Contents of $BUILD_DIR:"
93+
ls -la "$BUILD_DIR" || true
94+
95+
# clean previous artifact
96+
rm -f kaset.dmg || true
97+
98+
# find the main app explicitly by name to avoid Sparkle Updater.app
99+
APP_PATH=$(find "$BUILD_DIR" -type d -name "$APP_NAME" | head -n 1)
89100
90101
if [ -z "$APP_PATH" ]; then
91-
echo "Error: Could not find built app"
102+
echo "Error: Could not find $APP_NAME in $BUILD_DIR"
92103
exit 1
93104
fi
94105
@@ -105,7 +116,11 @@ jobs:
105116
fi
106117
107118
# Verify Universal Binary (Intel + Apple Silicon)
108-
ARCHS=$(lipo -archs "$APP_PATH/Contents/MacOS/Kaset" 2>/dev/null || echo "unknown")
119+
if [ -f "$APP_PATH/Contents/MacOS/Kaset" ]; then
120+
ARCHS=$(lipo -archs "$APP_PATH/Contents/MacOS/Kaset" 2>/dev/null || echo "unknown")
121+
else
122+
ARCHS="unknown"
123+
fi
109124
echo "Architectures: $ARCHS"
110125
if [[ "$ARCHS" != *"x86_64"* ]] || [[ "$ARCHS" != *"arm64"* ]]; then
111126
echo "Error: App is not a Universal Binary (found: $ARCHS)"

0 commit comments

Comments
 (0)