Update main.yml
This commit is contained in:
parent
8ccab3a671
commit
ebe3c572bb
1 changed files with 66 additions and 46 deletions
84
.github/workflows/main.yml
vendored
84
.github/workflows/main.yml
vendored
|
|
@ -23,15 +23,12 @@ jobs:
|
||||||
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: Hardcode Track Player Plugin
|
- name: Patch Track Player
|
||||||
run: |
|
run: |
|
||||||
# 1. Фиксим пути модулей внутри библиотеки
|
# 1. Create missing trackPlayer.js so original plugin import doesn't crash
|
||||||
TARGET_DIR="node_modules/react-native-track-player/lib/src"
|
node scripts/patch-track-player.js
|
||||||
if [ -d "$TARGET_DIR" ]; then
|
|
||||||
cp "$TARGET_DIR/trackPlayer" "$TARGET_DIR/trackPlayer.js" 2>/dev/null || true
|
|
||||||
fi
|
|
||||||
|
|
||||||
# 2. Переписываем сломанный плагин на чистый CommonJS
|
# 2. Also rewrite app.plugin.js to pure CommonJS as safety fallback
|
||||||
PLUGIN_PATH="node_modules/react-native-track-player/app.plugin.js"
|
PLUGIN_PATH="node_modules/react-native-track-player/app.plugin.js"
|
||||||
cat << 'EOF' > "$PLUGIN_PATH"
|
cat << 'EOF' > "$PLUGIN_PATH"
|
||||||
const { withInfoPlist } = require('@expo/config-plugins');
|
const { withInfoPlist } = require('@expo/config-plugins');
|
||||||
|
|
@ -47,36 +44,43 @@ jobs:
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
EOF
|
EOF
|
||||||
|
echo "Track player patched OK"
|
||||||
|
|
||||||
- name: Fix Git state
|
# 3. Add plugin back to app.json so AppDelegate gets audio mode set
|
||||||
run: |
|
node -e "
|
||||||
git config --global user.email "bot@example.com"
|
const fs = require('fs');
|
||||||
git config --global user.name "Builder Bot"
|
const cfg = JSON.parse(fs.readFileSync('app.json', 'utf8'));
|
||||||
git add .
|
const plugins = cfg.expo.plugins || [];
|
||||||
git commit -m "ci: patch track player and prepare assets" || true
|
if (!plugins.includes('react-native-track-player')) {
|
||||||
|
plugins.unshift('react-native-track-player');
|
||||||
|
cfg.expo.plugins = plugins;
|
||||||
|
fs.writeFileSync('app.json', JSON.stringify(cfg, null, 2));
|
||||||
|
console.log('Added plugin to app.json');
|
||||||
|
} else {
|
||||||
|
console.log('Plugin already in app.json');
|
||||||
|
}
|
||||||
|
"
|
||||||
|
|
||||||
- name: Fix Corrupted PNG Assets
|
- name: Fix PNG assets
|
||||||
run: |
|
run: |
|
||||||
# Исправляем PNG, чтобы сборщик не падал на "Unrecognised filter type"
|
find . -type f -iname "*.png" \
|
||||||
find . -type f -iname "*.png" -exec sips -s format png {} --out {} \;
|
-not -path "*/node_modules/*" \
|
||||||
|
-not -path "*/.git/*" \
|
||||||
|
-exec sips -s format png {} --out {} \; 2>/dev/null || true
|
||||||
|
|
||||||
- name: Expo prebuild
|
- name: Expo prebuild
|
||||||
run: npx expo prebuild --platform ios --clean --no-install
|
|
||||||
env:
|
env:
|
||||||
EXPO_NO_DOTENV: 1
|
EXPO_NO_DOTENV: 1
|
||||||
|
run: npx expo prebuild --platform ios --clean --no-install
|
||||||
|
|
||||||
- name: Install CocoaPods
|
- name: Pod install
|
||||||
run: |
|
run: cd ios && pod install --repo-update && cd ..
|
||||||
# Это создаст .xcworkspace, который нужен Xcode
|
|
||||||
cd ios && pod install --repo-update && cd ..
|
|
||||||
|
|
||||||
- name: Build unsigned app
|
- name: Build unsigned app
|
||||||
run: |
|
run: |
|
||||||
# Автоматический поиск воркспейса и схемы
|
|
||||||
WORKSPACE_PATH=$(find ios -maxdepth 1 -name "*.xcworkspace" | head -1)
|
WORKSPACE_PATH=$(find ios -maxdepth 1 -name "*.xcworkspace" | head -1)
|
||||||
SCHEME_NAME=$(basename "$WORKSPACE_PATH" .xcworkspace)
|
SCHEME_NAME=$(basename "$WORKSPACE_PATH" .xcworkspace)
|
||||||
|
echo "Building: $WORKSPACE_PATH | Scheme: $SCHEME_NAME"
|
||||||
echo "Building: $WORKSPACE_PATH with scheme: $SCHEME_NAME"
|
|
||||||
|
|
||||||
xcodebuild build \
|
xcodebuild build \
|
||||||
-workspace "$WORKSPACE_PATH" \
|
-workspace "$WORKSPACE_PATH" \
|
||||||
|
|
@ -86,20 +90,36 @@ jobs:
|
||||||
-derivedDataPath "$RUNNER_TEMP/DerivedData" \
|
-derivedDataPath "$RUNNER_TEMP/DerivedData" \
|
||||||
CODE_SIGN_IDENTITY="" \
|
CODE_SIGN_IDENTITY="" \
|
||||||
CODE_SIGNING_REQUIRED=NO \
|
CODE_SIGNING_REQUIRED=NO \
|
||||||
CODE_SIGNING_ALLOWED=NO
|
CODE_SIGNING_ALLOWED=NO \
|
||||||
|
ENABLE_BITCODE=NO
|
||||||
|
|
||||||
- name: Package IPA
|
- name: Package IPA
|
||||||
run: |
|
run: |
|
||||||
# Собираем .app в .ipa
|
APP_PATH=$(find "$RUNNER_TEMP/DerivedData/Build/Products" \
|
||||||
APP_PATH=$(find "$RUNNER_TEMP/DerivedData/Build/Products" -name "*.app" -type d | grep -v "\.xctest" | head -1)
|
-name "*.app" -type d ! -name "*.xctest" | head -1)
|
||||||
if [ -z "$APP_PATH" ]; then echo "Error: .app not found"; exit 1; fi
|
if [ -z "$APP_PATH" ]; then
|
||||||
|
echo "ERROR: .app not found in DerivedData"
|
||||||
|
find "$RUNNER_TEMP/DerivedData" -name "*.app" -type d 2>/dev/null || true
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
echo "App: $APP_PATH"
|
||||||
mkdir -p Payload
|
mkdir -p Payload
|
||||||
cp -r "$APP_PATH" Payload/
|
cp -r "$APP_PATH" Payload/
|
||||||
zip -qr burmalda-unsigned.ipa Payload
|
zip -qr burmalda-v1.0.7-beta-unsigned.ipa Payload
|
||||||
|
rm -rf Payload
|
||||||
|
echo "IPA size: $(du -sh burmalda-v1.0.7-beta-unsigned.ipa | cut -f1)"
|
||||||
|
|
||||||
- name: Upload IPA
|
- name: Upload IPA
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: burmalda-unsigned-ipa
|
name: burmalda-v1.0.7-beta-unsigned
|
||||||
path: burmalda-unsigned.ipa
|
path: burmalda-v1.0.7-beta-unsigned.ipa
|
||||||
retention-days: 1
|
retention-days: 7
|
||||||
|
|
||||||
|
- name: Summary
|
||||||
|
run: |
|
||||||
|
echo "### ✅ Burmalda v1.0.7 BETA" >> $GITHUB_STEP_SUMMARY
|
||||||
|
if [ -f burmalda-v1.0.7-beta-unsigned.ipa ]; then
|
||||||
|
echo "IPA size: $(du -sh burmalda-v1.0.7-beta-unsigned.ipa | cut -f1)" >> $GITHUB_STEP_SUMMARY
|
||||||
|
fi
|
||||||
|
echo "Скачай из раздела **Artifacts** этого run'а" >> $GITHUB_STEP_SUMMARY
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue