nodeshiftmusicburmalda/.github/workflows/main.yml
2026-04-29 00:23:26 +05:00

85 lines
3.1 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 18
uses: actions/setup-node@v4
with:
node-version: '18' # Node 18 более терпима к отсутствию расширений .js
- name: Install dependencies
run: |
npm install --legacy-peer-deps
npm install react-native-svg --legacy-peer-deps
- name: Surgical Patch (No Deletions)
run: |
# 1. Фиксим проблему с отсутствующим расширением .js в импорте
SRC_DIR="node_modules/react-native-track-player/lib/src"
if [ -d "$SRC_DIR" ]; then
# Создаем копию файла с расширением, чтобы импорт 'from ./trackPlayer' сработал
cp "$SRC_DIR/trackPlayer" "$SRC_DIR/trackPlayer.js" 2>/dev/null || true
echo "Fixed trackPlayer extension"
fi
# 2. Фиксим app.plugin.js, чтобы он не выбивал "Unexpected token"
# Мы просто оборачиваем его так, чтобы Node.js понимала экспорт
PLUGIN_FILE="node_modules/react-native-track-player/app.plugin.js"
if [ -f "$PLUGIN_FILE" ]; then
# Если там есть import/export, заменяем их на require/module.exports
sed -i '' 's/import /const /g' "$PLUGIN_FILE" || true
sed -i '' 's/from / = require/g' "$PLUGIN_FILE" || true
sed -i '' 's/export default /module.exports = /g' "$PLUGIN_FILE" || true
echo "Transpiled app.plugin.js to CommonJS"
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: surgical patch for track player" || 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 artifact
uses: actions/upload-artifact@v4
with:
name: burmalda-unsigned-ipa
path: burmalda-unsigned.ipa
retention-days: 7