Skip to content

Commit 7ed1b67

Browse files
Emin017claude
andauthored
ci: build Release configuration and preserve .app artifacts (#11)
- Preserve generated .app files as downloadable artifacts with 30-day retention - Update artifact naming to clearly indicate Release build version 🤖 Generated with [Claude Code](https://claude.ai/code) Co-authored-by: Claude <noreply@anthropic.com>
1 parent 4e5d165 commit 7ed1b67

1 file changed

Lines changed: 76 additions & 27 deletions

File tree

.github/workflows/ci.yaml

Lines changed: 76 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,74 @@
11
name: CI
2+
23
on:
34
push:
45
branches: [main]
56
pull_request:
67
branches: [main]
8+
9+
env:
10+
XCODE_PROJECT: mplayer.xcodeproj
11+
XCODE_SCHEME: mplayer
12+
XCODE_DESTINATION: 'platform=macOS'
13+
BUILD_SETTINGS: 'CODE_SIGNING_ALLOWED=NO'
14+
715
jobs:
816
build-and-test:
917
runs-on: macos-latest
1018
steps:
1119
- name: Checkout code
1220
uses: actions/checkout@v4
21+
1322
- name: Show Xcode version
1423
run: xcodebuild -version
15-
- name: Show available destinations
16-
run: xcodebuild -project mplayer.xcodeproj -scheme mplayer -showdestinations
17-
- name: Clean build directory
18-
run: |
19-
xcodebuild clean \
20-
-project mplayer.xcodeproj \
21-
-scheme mplayer
22-
- name: Build project for macOS
23-
run: |
24-
xcodebuild build \
25-
-project mplayer.xcodeproj \
26-
-scheme mplayer \
27-
-destination 'platform=macOS' \
28-
-configuration Debug \
29-
CODE_SIGNING_ALLOWED=NO \
30-
ONLY_ACTIVE_ARCH=YES
31-
- name: Run unit tests
24+
25+
- name: Build and test (Debug)
3226
run: |
3327
xcodebuild test \
34-
-project mplayer.xcodeproj \
35-
-scheme mplayer \
36-
-destination 'platform=macOS' \
28+
-project ${{ env.XCODE_PROJECT }} \
29+
-scheme ${{ env.XCODE_SCHEME }} \
30+
-destination ${{ env.XCODE_DESTINATION }} \
3731
-configuration Debug \
38-
CODE_SIGNING_ALLOWED=NO \
32+
-derivedDataPath ./DerivedData \
33+
${{ env.BUILD_SETTINGS }} \
3934
ONLY_ACTIVE_ARCH=YES
40-
- name: Build for Release configuration
35+
36+
- name: Build Release .app for distribution
4137
run: |
38+
echo "🚀 Building Release .app for distribution..."
4239
xcodebuild build \
43-
-project mplayer.xcodeproj \
44-
-scheme mplayer \
45-
-destination 'platform=macOS' \
40+
-project ${{ env.XCODE_PROJECT }} \
41+
-scheme ${{ env.XCODE_SCHEME }} \
42+
-destination ${{ env.XCODE_DESTINATION }} \
4643
-configuration Release \
47-
CODE_SIGNING_ALLOWED=NO \
48-
ONLY_ACTIVE_ARCH=YES
44+
-derivedDataPath ./ReleaseData \
45+
${{ env.BUILD_SETTINGS }} \
46+
ONLY_ACTIVE_ARCH=NO \
47+
ARCHS="arm64"
48+
49+
- name: Package Release .app
50+
run: |
51+
# Create artifacts directory
52+
mkdir -p ./artifacts
53+
54+
# Find and copy Release .app
55+
RELEASE_APP=$(find ./ReleaseData -path "*/Release/*.app" -type d | head -1)
56+
if [ -n "$RELEASE_APP" ]; then
57+
cp -R "$RELEASE_APP" ./artifacts/mplayer-Release.app
58+
echo "✅ Release .app packaged successfully"
59+
ls -la ./artifacts/
60+
else
61+
echo "❌ Release .app not found!"
62+
exit 1
63+
fi
64+
65+
- name: Upload Release .app
66+
uses: actions/upload-artifact@v4
67+
with:
68+
name: mplayer-release-${{ github.run_number }}
69+
path: ./artifacts/
70+
retention-days: 30
71+
4972
code-quality-check:
5073
runs-on: macos-latest
5174
steps:
@@ -137,7 +160,33 @@ jobs:
137160
if [ -d "./build/mplayer.xcarchive" ]; then
138161
echo "Archive created successfully"
139162
ls -la ./build/mplayer.xcarchive/
163+
164+
# Also check for .app inside archive
165+
find ./build/mplayer.xcarchive -name "*.app" -type d
140166
else
141167
echo "Archive not found"
142168
exit 1
143169
fi
170+
- name: Extract .app from archive
171+
run: |
172+
echo "📦 Extracting .app from archive..."
173+
174+
# Create archive artifacts directory
175+
mkdir -p ./archive-artifacts
176+
177+
# Find and copy .app from archive
178+
ARCHIVE_APP=$(find ./build/mplayer.xcarchive -name "*.app" -type d | head -1)
179+
if [ -n "$ARCHIVE_APP" ]; then
180+
cp -R "$ARCHIVE_APP" ./archive-artifacts/mplayer-Archive.app
181+
echo "✅ Extracted .app from archive"
182+
ls -la ./archive-artifacts/
183+
else
184+
echo "❌ No .app found in archive"
185+
fi
186+
- name: Upload archive .app artifact
187+
uses: actions/upload-artifact@v4
188+
if: success()
189+
with:
190+
name: mplayer-archive-app-${{ github.run_number }}
191+
path: ./archive-artifacts/
192+
retention-days: 30

0 commit comments

Comments
 (0)