Update main.yml
This commit is contained in:
parent
933f7a2206
commit
c4ed07cb6e
1 changed files with 16 additions and 28 deletions
44
.github/workflows/main.yml
vendored
44
.github/workflows/main.yml
vendored
|
|
@ -20,76 +20,64 @@ jobs:
|
|||
|
||||
- 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
|
||||
- name: Patch and Fix Code
|
||||
run: |
|
||||
# 1. ГЛУБОКИЙ ФИКС ПУТЕЙ (решаем ошибку со скриншота)
|
||||
# Нам нужно, чтобы файл назывался именно trackPlayer.js, а не просто trackPlayer
|
||||
# 1. Фикс плеера (пути модулей)
|
||||
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 (твой старый рабочий код)
|
||||
# 2. Твой рабочий патч плагина
|
||||
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');
|
||||
}
|
||||
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 {} \;
|
||||
# 3. КИЛЛЕР-ФИЧА: Отключаем expo-updates в app.json перед билдом, чтобы Xcode не падал на скриптах
|
||||
# Это предотвратит ошибку Exit Code 65
|
||||
sed -i '' 's/"expo-updates": {/"expo-updates-disabled": {/g' app.json || true
|
||||
|
||||
- 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: Fix Assets
|
||||
run: find . -type f -iname "*.png" -exec sips -s format png {} --out {} \;
|
||||
|
||||
- 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 ..
|
||||
run: 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
|
||||
CODE_SIGN_IDENTITY="" \
|
||||
ENABLE_BITCODE=NO \
|
||||
STRIP_INSTALLED_PRODUCT=YES \
|
||||
| xcpretty
|
||||
|
||||
- name: Package IPA
|
||||
run: |
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue