nodeshiftmusicburmalda/.github/workflows/main.yml
2026-04-29 00:18:13 +05:00

88 lines
3 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: Force Fix Track Player (Stub Method)
run: |
# Путь к проблемному файлу
TARGET_DIR="node_modules/react-native-track-player/lib/src"
TARGET_FILE="$TARGET_DIR/index.js"
if [ -d "$TARGET_DIR" ]; then
# Создаем абсолютно чистый файл без импортов, которые валят сборку
echo "export * from './trackPlayer.js';" > "$TARGET_FILE"
# Если файла trackPlayer без расширения нет, создаем и его как заглушку
if [ ! -f "$TARGET_DIR/trackPlayer.js" ] && [ -f "$TARGET_DIR/trackPlayer" ]; then
cp "$TARGET_DIR/trackPlayer" "$TARGET_DIR/trackPlayer.js"
fi
echo "Successfully stubbed broken imports in $TARGET_FILE"
fi
- name: Remove broken Config Plugin
run: |
if [ -f "app.json" ]; then
cat app.json | jq 'del(.expo.plugins[] | select(. == "react-native-track-player" or .[0] == "react-native-track-player"))' > app.json.tmp && mv app.json.tmp app.json
fi
- 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: stub broken modules" || 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)
if [ -z "$APP_PATH" ]; then echo "ERROR: .app not found"; exit 1; fi
mkdir -p Payload
cp -r "$APP_PATH" Payload/
zip -qr burmalda-unsigned.ipa Payload
rm -rf Payload
- name: Upload IPA artifact
uses: actions/upload-artifact@v4
with:
name: burmalda-unsigned-ipa
path: burmalda-unsigned.ipa
retention-days: 30