From daf7f69277a1bee1794ccbc0a9873ffb2860f6b0 Mon Sep 17 00:00:00 2001 From: Savsis Date: Fri, 8 May 2026 12:59:57 +0500 Subject: [PATCH] Update main.yml --- .github/workflows/main.yml | 118 ++++++++++++++++--------------------- 1 file changed, 51 insertions(+), 67 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f7ce8a7..c504533 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,4 +1,4 @@ -name: Build iOS IPA +name: NodeShiftMusic iOS Build on: push: @@ -6,7 +6,8 @@ on: workflow_dispatch: jobs: - build: + build-ipa: + name: Build Unsigned IPA runs-on: macos-latest steps: @@ -17,89 +18,72 @@ jobs: uses: actions/setup-node@v4 with: node-version: '20' + cache: 'npm' - name: Install dependencies - run: | - npm install --legacy-peer-deps - npm install react-native-svg --legacy-peer-deps + run: npm install --legacy-peer-deps - - name: Hardcode Track Player Plugin + - name: Fix PNG assets (jimp compat) run: | - # 1. Фиксим пути модулей внутри библиотеки - TARGET_DIR="node_modules/react-native-track-player/lib/src" - if [ -d "$TARGET_DIR" ]; then - cp "$TARGET_DIR/trackPlayer" "$TARGET_DIR/trackPlayer.js" 2>/dev/null || true - fi - - # 2. Переписываем сломанный плагин на чистый CommonJS - PLUGIN_PATH="node_modules/react-native-track-player/app.plugin.js" - cat << 'EOF' > "$PLUGIN_PATH" - const { withInfoPlist } = require('@expo/config-plugins'); - module.exports = function(config) { - return withInfoPlist(config, (config) => { - if (!config.modResults.UIBackgroundModes) { - config.modResults.UIBackgroundModes = []; - } - if (!config.modResults.UIBackgroundModes.includes('audio')) { - config.modResults.UIBackgroundModes.push('audio'); - } - return config; - }); - }; - EOF - - - name: Fix Git state - run: | - git config --global user.email "bot@example.com" - git config --global user.name "Builder Bot" - git add . - git commit -m "ci: patch track player and prepare assets" || true - - - name: Fix Corrupted PNG Assets - run: | - # Исправляем PNG, чтобы сборщик не падал на "Unrecognised filter type" - find . -type f -iname "*.png" -exec sips -s format png {} --out {} \; + echo "Re-encoding PNGs to strip unsupported filter types..." + find assets -name "*.png" | while read f; do + sips -s format png "$f" --out "$f" 2>/dev/null && echo " fixed: $f" || echo " skip: $f" + done - name: Expo prebuild - run: npx expo prebuild --platform ios --clean --no-install env: - EXPO_NO_DOTENV: 1 + EXPO_NO_DOTENV: + run: npx expo prebuild --platform ios --clean - - name: Install CocoaPods - run: | - # Это создаст .xcworkspace, который нужен Xcode - cd ios && pod install --repo-update && cd .. + - name: Install Pods + working-directory: ios + run: pod install --repo-update - - name: Build unsigned app + - name: Find workspace & scheme + id: xcode run: | - # Автоматический поиск воркспейса и схемы - WORKSPACE_PATH=$(find ios -maxdepth 1 -name "*.xcworkspace" | head -1) - SCHEME_NAME=$(basename "$WORKSPACE_PATH" .xcworkspace) - - echo "Building: $WORKSPACE_PATH with scheme: $SCHEME_NAME" - - xcodebuild build \ - -workspace "$WORKSPACE_PATH" \ - -scheme "$SCHEME_NAME" \ + WS=$(find ios -name "*.xcworkspace" -maxdepth 2 | head -1) + SCHEME=$(basename "$WS" .xcworkspace) + echo "workspace=$WS" >> $GITHUB_OUTPUT + echo "scheme=$SCHEME" >> $GITHUB_OUTPUT + echo "Workspace: $WS | Scheme: $SCHEME" + + - name: Build unsigned archive + run: | + xcodebuild archive \ + -workspace "${{ steps.xcode.outputs.workspace }}" \ + -scheme "${{ steps.xcode.outputs.scheme }}" \ -configuration Release \ -sdk iphoneos \ - -derivedDataPath "$RUNNER_TEMP/DerivedData" \ - CODE_SIGN_IDENTITY="" \ + -archivePath "$RUNNER_TEMP/NodeShiftMusic.xcarchive" \ CODE_SIGNING_REQUIRED=NO \ - CODE_SIGNING_ALLOWED=NO + CODE_SIGN_IDENTITY="" \ + CODE_SIGNING_ALLOWED=NO \ + ENABLE_BITCODE=NO \ + 2>&1 | xcpretty || true - name: Package IPA run: | - # Собираем .app в .ipa - APP_PATH=$(find "$RUNNER_TEMP/DerivedData/Build/Products" -name "*.app" -type d | grep -v "\.xctest" | head -1) - if [ -z "$APP_PATH" ]; then echo "Error: .app not found"; exit 1; fi + APPS="$RUNNER_TEMP/NodeShiftMusic.xcarchive/Products/Applications" mkdir -p Payload - cp -r "$APP_PATH" Payload/ - zip -qr burmalda-unsigned.ipa Payload + cp -r "$APPS/"*.app Payload/ + zip -qr NodeShiftMusic-unsigned.ipa Payload + rm -rf Payload + echo "IPA size: $(du -sh NodeShiftMusic-unsigned.ipa | cut -f1)" - name: Upload IPA uses: actions/upload-artifact@v4 with: - name: burmalda-unsigned-ipa - path: burmalda-unsigned.ipa - retention-days: 1 + name: NodeShiftMusic-unsigned + path: NodeShiftMusic-unsigned.ipa + retention-days: 90 + + - name: Summary + run: | + echo "## NodeShiftMusic Build" >> $GITHUB_STEP_SUMMARY + echo "Branch: \`${{ github.ref_name }}\`" >> $GITHUB_STEP_SUMMARY + echo "Commit: \`${{ github.sha }}\`" >> $GITHUB_STEP_SUMMARY + if [ -f NodeShiftMusic-unsigned.ipa ]; then + echo "IPA: $(du -sh NodeShiftMusic-unsigned.ipa | cut -f1)" >> $GITHUB_STEP_SUMMARY + echo "Скачай из раздела Artifacts этого run'а" >> $GITHUB_STEP_SUMMARY + fi