docs: add CLAUDE.md for project guidance and feature overview (#14) #40
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| env: | |
| XCODE_PROJECT: mplayer.xcodeproj | |
| XCODE_SCHEME: mplayer | |
| XCODE_DESTINATION: 'platform=macOS' | |
| BUILD_SETTINGS: 'CODE_SIGNING_ALLOWED=NO' | |
| jobs: | |
| build-and-test: | |
| runs-on: macos-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Show Xcode version | |
| run: xcodebuild -version | |
| - name: Build and test (Debug) | |
| run: | | |
| xcodebuild test \ | |
| -project ${{ env.XCODE_PROJECT }} \ | |
| -scheme ${{ env.XCODE_SCHEME }} \ | |
| -destination ${{ env.XCODE_DESTINATION }} \ | |
| -configuration Debug \ | |
| -derivedDataPath ./DerivedData \ | |
| ${{ env.BUILD_SETTINGS }} \ | |
| ONLY_ACTIVE_ARCH=YES | |
| - name: Build Release .app for distribution | |
| run: | | |
| echo "π Building Release .app for distribution..." | |
| xcodebuild build \ | |
| -project ${{ env.XCODE_PROJECT }} \ | |
| -scheme ${{ env.XCODE_SCHEME }} \ | |
| -destination ${{ env.XCODE_DESTINATION }} \ | |
| -configuration Release \ | |
| -derivedDataPath ./ReleaseData \ | |
| ${{ env.BUILD_SETTINGS }} \ | |
| ONLY_ACTIVE_ARCH=NO \ | |
| ARCHS="arm64" | |
| - name: Package Release .app | |
| run: | | |
| # Create artifacts directory | |
| mkdir -p ./artifacts | |
| # Find and copy Release .app | |
| RELEASE_APP=$(find ./ReleaseData -path "*/Release/*.app" -type d | head -1) | |
| if [ -n "$RELEASE_APP" ]; then | |
| cp -R "$RELEASE_APP" ./artifacts/mplayer-Release.app | |
| echo "β Release .app packaged successfully" | |
| ls -la ./artifacts/ | |
| else | |
| echo "β Release .app not found!" | |
| exit 1 | |
| fi | |
| - name: Upload Release .app | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: mplayer-release-${{ github.run_number }} | |
| path: ./artifacts/ | |
| retention-days: 30 | |
| code-quality-check: | |
| runs-on: macos-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Run code quality checks | |
| run: | | |
| echo "π Running code quality checks..." | |
| # Check for TODO/FIXME comments | |
| if grep -r "TODO\|FIXME\|XXX" mplayer/ --include="*.swift" || true; then | |
| echo "π Found TODO/FIXME comments (review needed)" | |
| fi | |
| # Check for potential force unwrapping | |
| if grep -r "!" mplayer/ --include="*.swift" | grep -v "//\|print" || true; then | |
| echo "β οΈ Found potential force unwrapping (review for safety)" | |
| fi | |
| # Check for print statements | |
| if grep -r "print(" mplayer/ --include="*.swift" || true; then | |
| echo "π Found print statements (consider using proper logging)" | |
| fi | |
| echo "β Code quality check completed" | |
| security-check: | |
| runs-on: macos-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Security and configuration checks | |
| run: | | |
| echo "π Running security checks..." | |
| sensitive_found=false | |
| # Check for sensitive information | |
| if grep -ri "password\|secret\|api_key\|apikey\|token\|credential" mplayer/ --include="*.swift" --include="*.plist" || true; then | |
| echo "β οΈ Found potential sensitive information" | |
| sensitive_found=true | |
| fi | |
| # Check for AWS keys | |
| if grep -ri "AKIAI\|AKIA[0-9A-Z]\{16\}" mplayer/ --include="*.swift" --include="*.plist" || true; then | |
| echo "β οΈ Found potential AWS access key" | |
| sensitive_found=true | |
| fi | |
| if [ "$sensitive_found" = false ]; then | |
| echo "β No obvious sensitive information found" | |
| fi | |
| # Check project configuration | |
| echo "π Checking project configuration..." | |
| if grep -i "PRODUCT_BUNDLE_IDENTIFIER\|DEVELOPMENT_TEAM" ${{ env.XCODE_PROJECT }}/project.pbxproj | head -5; then | |
| echo "Project configuration found" | |
| fi | |
| echo "β Security checks completed" | |
| archive-verification: | |
| runs-on: macos-latest | |
| needs: build-and-test | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Download Release artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: mplayer-release-${{ github.run_number }} | |
| path: ./downloaded-artifacts | |
| - name: Verify archive can be created from Release .app | |
| run: | | |
| echo "π¦ Verifying archive creation..." | |
| if [ -d "./downloaded-artifacts/mplayer-Release.app" ]; then | |
| echo "β Release .app found and ready for distribution" | |
| ls -la ./downloaded-artifacts/ | |
| # Get basic app info | |
| echo "App bundle contents:" | |
| ls -la "./downloaded-artifacts/mplayer-Release.app/Contents/" | |
| else | |
| echo "β Release .app verification failed" | |
| exit 1 | |
| fi |