nodeshiftmusicburmalda/.github/workflows/main.yml
2026-05-05 18:58:48 +05:00

106 lines
3.9 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

name: Build iOS IPA
on:
push:
branches: [main, master]
workflow_dispatch:
jobs:
build:
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node 20
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install dependencies
run: |
# Ставим зависимости, игнорируя скрипты, чтобы они не падали на полпути
npm install --legacy-peer-deps --ignore-scripts
npm install react-native-svg --legacy-peer-deps --ignore-scripts
- name: Hardcode Track Player Fix
run: |
# 1. ГЛУБОКИЙ ФИКС ПУТЕЙ (решаем ошибку со скриншота)
# Нам нужно, чтобы файл назывался именно trackPlayer.js, а не просто trackPlayer
TARGET_DIR="node_modules/react-native-track-player/lib/src"
if [ -d "$TARGET_DIR" ]; then
# Копируем файл, добавляя расширение .js, если его нет
cp "$TARGET_DIR/trackPlayer.js" "$TARGET_DIR/trackPlayer.js" 2>/dev/null || \
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 Corrupted PNG Assets
run: |
# Твой фикс для битых картинок, чтобы Xcode не ругался
find . -type f -iname "*.png" -exec sips -s format png {} --out {} \;
- 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 assets" || true
- name: Expo prebuild
# Используем --no-install, чтобы наши патчи в node_modules не затерлись
run: npx expo prebuild --platform ios --clean --no-install
env:
EXPO_NO_DOTENV: 1
- name: Install CocoaPods
run: |
# Генерируем .xcworkspace
cd ios && pod install --repo-update && cd ..
- name: Build unsigned app
run: |
WORKSPACE_PATH=$(find ios -maxdepth 1 -name "*.xcworkspace" | head -1)
SCHEME_NAME=$(basename "$WORKSPACE_PATH" .xcworkspace)
xcodebuild build \
-workspace "$WORKSPACE_PATH" \
-scheme "$SCHEME_NAME" \
-configuration Release \
-sdk iphoneos \
-derivedDataPath "$RUNNER_TEMP/DerivedData" \
CODE_SIGN_IDENTITY="" \
CODE_SIGNING_REQUIRED=NO \
CODE_SIGNING_ALLOWED=NO \
ENABLE_BITCODE=NO
- name: Package IPA
run: |
APP_PATH=$(find "$RUNNER_TEMP/DerivedData/Build/Products" -name "*.app" -type d | grep -v "\.xctest" | head -1)
mkdir -p Payload
cp -r "$APP_PATH" Payload/
zip -qr burmalda-unsigned.ipa Payload
- name: Upload IPA
uses: actions/upload-artifact@v4
with:
name: burmalda-unsigned-ipa
path: burmalda-unsigned.ipa
retention-days: 1