88 lines
2.8 KiB
YAML
88 lines
2.8 KiB
YAML
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
|
|
npm install react-native-svg --legacy-peer-deps
|
|
|
|
- name: Hardcode Track Player Plugin
|
|
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: rewrite broken plugin" || true
|
|
|
|
- name: Expo prebuild
|
|
run: npx expo prebuild --platform ios --clean --no-install
|
|
env:
|
|
EXPO_NO_DOTENV: 1
|
|
|
|
- name: Build unsigned app
|
|
run: |
|
|
WORKSPACE=$(find ios -name "*.xcworkspace" -type d | head -1)
|
|
SCHEME=$(basename "$WORKSPACE" .xcworkspace)
|
|
xcodebuild build \
|
|
-workspace "$WORKSPACE" \
|
|
-scheme "$SCHEME" \
|
|
-configuration Release \
|
|
-sdk iphoneos \
|
|
-derivedDataPath "$RUNNER_TEMP/DerivedData" \
|
|
CODE_SIGN_IDENTITY="" \
|
|
CODE_SIGNING_REQUIRED=NO \
|
|
CODE_SIGNING_ALLOWED=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
|