Update main.yml

This commit is contained in:
Savsis 2026-04-28 22:31:15 +05:00 • committed by GitHub
parent 64e33b4e19
commit 5dce50fe9f

View file

@ -13,25 +13,32 @@ jobs:
- name: Checkout - name: Checkout
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: Setup Node 18 - name: Setup Node 20
uses: actions/setup-node@v4 uses: actions/setup-node@v4
with: with:
node-version: '18' # Node 18 менее капризна к импортам node-version: '20'
- name: Install dependencies - name: Clean and Install
run: | run: |
rm -rf node_modules rm -rf node_modules package-lock.json
npm install --legacy-peer-deps npm install --legacy-peer-deps
npm install react-native-svg --legacy-peer-deps npm install react-native-svg --legacy-peer-deps
- name: Patch Broken Library (The Fix) - name: Patch Track Player (Config Plugin Fix)
run: | run: |
# Этот шаг исправляет ошибку импорта в самом плеере # Фиксим основной вход плагина, если он есть
# Мы просто добавляем .js там, где его забыли разработчики библиотеки PLUGIN_PATH="node_modules/react-native-track-player/app.plugin.js"
FILE="node_modules/react-native-track-player/lib/src/index.js" if [ -f "$PLUGIN_PATH" ]; then
if [ -f "$FILE" ]; then echo "Patching Config Plugin..."
sed -i '' "s/from '.\/trackPlayer'/from '.\/trackPlayer.js'/g" "$FILE" # Заменяем импорты на реквайры, чтобы Node не ныла
echo "Patch applied to $FILE" sed -i '' "s/import/const/g" "$PLUGIN_PATH" || true
sed -i '' "s/export default/module.exports =/g" "$PLUGIN_PATH" || true
fi
# Фиксим index.js, который вызывал ошибку ранее
INDEX_PATH="node_modules/react-native-track-player/lib/src/index.js"
if [ -f "$INDEX_PATH" ]; then
sed -i '' "s/from '.\/trackPlayer'/from '.\/trackPlayer.js'/g" "$INDEX_PATH" || true
fi fi
- name: Fix Git state - name: Fix Git state
@ -39,7 +46,7 @@ jobs:
git config --global user.email "bot@example.com" git config --global user.email "bot@example.com"
git config --global user.name "Builder Bot" git config --global user.name "Builder Bot"
git add . git add .
git commit -m "ci: fix dirty tree and patches" || true git commit -m "ci: fix plugins" || true
- name: Expo prebuild - name: Expo prebuild
run: npx expo prebuild --platform ios --clean --no-install run: npx expo prebuild --platform ios --clean --no-install