Update main.yml
This commit is contained in:
parent
5748d2d13c
commit
9898cecefe
1 changed files with 16 additions and 65 deletions
81
.github/workflows/main.yml
vendored
81
.github/workflows/main.yml
vendored
|
|
@ -17,89 +17,40 @@ jobs:
|
||||||
uses: actions/setup-node@v4
|
uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: '20'
|
node-version: '20'
|
||||||
|
cache: 'npm'
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: npm install
|
||||||
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: patch track player and prepare assets" || true
|
|
||||||
|
|
||||||
- name: Fix Corrupted PNG Assets
|
|
||||||
run: |
|
|
||||||
# Исправляем PNG, чтобы сборщик не падал на "Unrecognised filter type"
|
|
||||||
find . -type f -iname "*.png" -exec sips -s format png {} --out {} \;
|
|
||||||
|
|
||||||
- name: Expo prebuild
|
- name: Expo prebuild
|
||||||
run: npx expo prebuild --platform ios --clean --no-install
|
run: npx expo prebuild --platform ios --clean
|
||||||
env:
|
env:
|
||||||
EXPO_NO_DOTENV: 1
|
EXPO_NO_DOTENV: 1
|
||||||
|
|
||||||
- name: Install CocoaPods
|
- name: Build unsigned archive
|
||||||
run: |
|
run: |
|
||||||
# Это создаст .xcworkspace, который нужен Xcode
|
xcodebuild archive \
|
||||||
cd ios && pod install --repo-update && cd ..
|
-workspace "ios/Burmalda Music.xcworkspace" \
|
||||||
|
-scheme "Burmalda Music" \
|
||||||
- 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 with scheme: $SCHEME_NAME"
|
|
||||||
|
|
||||||
xcodebuild build \
|
|
||||||
-workspace "$WORKSPACE_PATH" \
|
|
||||||
-scheme "$SCHEME_NAME" \
|
|
||||||
-configuration Release \
|
-configuration Release \
|
||||||
-sdk iphoneos \
|
-sdk iphoneos \
|
||||||
-derivedDataPath "$RUNNER_TEMP/DerivedData" \
|
-archivePath "$RUNNER_TEMP/burmalda.xcarchive" \
|
||||||
CODE_SIGN_IDENTITY="" \
|
|
||||||
CODE_SIGNING_REQUIRED=NO \
|
CODE_SIGNING_REQUIRED=NO \
|
||||||
CODE_SIGNING_ALLOWED=NO
|
CODE_SIGN_IDENTITY="" \
|
||||||
|
CODE_SIGNING_ALLOWED=NO \
|
||||||
|
ENABLE_BITCODE=NO \
|
||||||
|
| xcpretty || true
|
||||||
|
|
||||||
- name: Package IPA
|
- name: Package IPA
|
||||||
run: |
|
run: |
|
||||||
# Собираем .app в .ipa
|
|
||||||
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
|
mkdir -p Payload
|
||||||
cp -r "$APP_PATH" Payload/
|
cp -r "$RUNNER_TEMP/burmalda.xcarchive/Products/Applications/"*.app Payload/
|
||||||
zip -qr burmalda-unsigned.ipa Payload
|
zip -qr burmalda-unsigned.ipa Payload
|
||||||
|
rm -rf Payload
|
||||||
|
|
||||||
- name: Upload IPA
|
- name: Upload IPA artifact
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: burmalda-unsigned-ipa
|
name: burmalda-unsigned-ipa
|
||||||
path: burmalda-unsigned.ipa
|
path: burmalda-unsigned.ipa
|
||||||
retention-days: 1
|
retention-days: 30
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue