nodeshiftmusicburmalda/.github/workflows/main.yml
Workflow config file is invalid. Please check your config file: yaml: line 34: could not find expected ':'
2026-05-08 13:50:00 +05:00

125 lines
4.2 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
npm install react-native-svg --legacy-peer-deps
- name: Patch Track Player
run: |
# 1. Create missing trackPlayer.js so original plugin import doesn't crash
node scripts/patch-track-player.js
# 2. Also rewrite app.plugin.js to pure CommonJS as safety fallback
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
echo "Track player patched OK"
# 3. Add plugin back to app.json so AppDelegate gets audio mode set
node -e "
const fs = require('fs');
const cfg = JSON.parse(fs.readFileSync('app.json', 'utf8'));
const plugins = cfg.expo.plugins || [];
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 PNG assets
run: |
find . -type f -iname "*.png" \
-not -path "*/node_modules/*" \
-not -path "*/.git/*" \
-exec sips -s format png {} --out {} \; 2>/dev/null || true
- name: Expo prebuild
env:
EXPO_NO_DOTENV: 1
run: npx expo prebuild --platform ios --clean --no-install
- name: Pod install
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)
echo "Building: $WORKSPACE_PATH | Scheme: $SCHEME_NAME"
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 ! -name "*.xctest" | head -1)
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
cp -r "$APP_PATH" 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
uses: actions/upload-artifact@v4
with:
name: burmalda-v1.0.7-beta-unsigned
path: burmalda-v1.0.7-beta-unsigned.ipa
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