Update main.yml
This commit is contained in:
parent
011bda7ff5
commit
daf7f69277
1 changed files with 51 additions and 67 deletions
118
.github/workflows/main.yml
vendored
118
.github/workflows/main.yml
vendored
|
|
@ -1,4 +1,4 @@
|
||||||
name: Build iOS IPA
|
name: NodeShiftMusic iOS Build
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
|
|
@ -6,7 +6,8 @@ on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build-ipa:
|
||||||
|
name: Build Unsigned IPA
|
||||||
runs-on: macos-latest
|
runs-on: macos-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
|
@ -17,89 +18,72 @@ 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 --legacy-peer-deps
|
||||||
npm install --legacy-peer-deps
|
|
||||||
npm install react-native-svg --legacy-peer-deps
|
|
||||||
|
|
||||||
- name: Hardcode Track Player Plugin
|
- name: Fix PNG assets (jimp compat)
|
||||||
run: |
|
run: |
|
||||||
# 1. Фиксим пути модулей внутри библиотеки
|
echo "Re-encoding PNGs to strip unsupported filter types..."
|
||||||
TARGET_DIR="node_modules/react-native-track-player/lib/src"
|
find assets -name "*.png" | while read f; do
|
||||||
if [ -d "$TARGET_DIR" ]; then
|
sips -s format png "$f" --out "$f" 2>/dev/null && echo " fixed: $f" || echo " skip: $f"
|
||||||
cp "$TARGET_DIR/trackPlayer" "$TARGET_DIR/trackPlayer.js" 2>/dev/null || true
|
done
|
||||||
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
|
|
||||||
env:
|
env:
|
||||||
EXPO_NO_DOTENV: 1
|
EXPO_NO_DOTENV:
|
||||||
|
run: npx expo prebuild --platform ios --clean
|
||||||
|
|
||||||
- name: Install CocoaPods
|
- name: Install Pods
|
||||||
run: |
|
working-directory: ios
|
||||||
# Это создаст .xcworkspace, который нужен Xcode
|
run: pod install --repo-update
|
||||||
cd ios && pod install --repo-update && cd ..
|
|
||||||
|
|
||||||
- name: Build unsigned app
|
- name: Find workspace & scheme
|
||||||
|
id: xcode
|
||||||
run: |
|
run: |
|
||||||
# Автоматический поиск воркспейса и схемы
|
WS=$(find ios -name "*.xcworkspace" -maxdepth 2 | head -1)
|
||||||
WORKSPACE_PATH=$(find ios -maxdepth 1 -name "*.xcworkspace" | head -1)
|
SCHEME=$(basename "$WS" .xcworkspace)
|
||||||
SCHEME_NAME=$(basename "$WORKSPACE_PATH" .xcworkspace)
|
echo "workspace=$WS" >> $GITHUB_OUTPUT
|
||||||
|
echo "scheme=$SCHEME" >> $GITHUB_OUTPUT
|
||||||
echo "Building: $WORKSPACE_PATH with scheme: $SCHEME_NAME"
|
echo "Workspace: $WS | Scheme: $SCHEME"
|
||||||
|
|
||||||
xcodebuild build \
|
- name: Build unsigned archive
|
||||||
-workspace "$WORKSPACE_PATH" \
|
run: |
|
||||||
-scheme "$SCHEME_NAME" \
|
xcodebuild archive \
|
||||||
|
-workspace "${{ steps.xcode.outputs.workspace }}" \
|
||||||
|
-scheme "${{ steps.xcode.outputs.scheme }}" \
|
||||||
-configuration Release \
|
-configuration Release \
|
||||||
-sdk iphoneos \
|
-sdk iphoneos \
|
||||||
-derivedDataPath "$RUNNER_TEMP/DerivedData" \
|
-archivePath "$RUNNER_TEMP/NodeShiftMusic.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 \
|
||||||
|
2>&1 | xcpretty || true
|
||||||
|
|
||||||
- name: Package IPA
|
- name: Package IPA
|
||||||
run: |
|
run: |
|
||||||
# Собираем .app в .ipa
|
APPS="$RUNNER_TEMP/NodeShiftMusic.xcarchive/Products/Applications"
|
||||||
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 "$APPS/"*.app Payload/
|
||||||
zip -qr burmalda-unsigned.ipa Payload
|
zip -qr NodeShiftMusic-unsigned.ipa Payload
|
||||||
|
rm -rf Payload
|
||||||
|
echo "IPA size: $(du -sh NodeShiftMusic-unsigned.ipa | cut -f1)"
|
||||||
|
|
||||||
- name: Upload IPA
|
- name: Upload IPA
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: burmalda-unsigned-ipa
|
name: NodeShiftMusic-unsigned
|
||||||
path: burmalda-unsigned.ipa
|
path: NodeShiftMusic-unsigned.ipa
|
||||||
retention-days: 1
|
retention-days: 90
|
||||||
|
|
||||||
|
- name: Summary
|
||||||
|
run: |
|
||||||
|
echo "## NodeShiftMusic Build" >> $GITHUB_STEP_SUMMARY
|
||||||
|
echo "Branch: \`${{ github.ref_name }}\`" >> $GITHUB_STEP_SUMMARY
|
||||||
|
echo "Commit: \`${{ github.sha }}\`" >> $GITHUB_STEP_SUMMARY
|
||||||
|
if [ -f NodeShiftMusic-unsigned.ipa ]; then
|
||||||
|
echo "IPA: $(du -sh NodeShiftMusic-unsigned.ipa | cut -f1)" >> $GITHUB_STEP_SUMMARY
|
||||||
|
echo "Скачай из раздела Artifacts этого run'а" >> $GITHUB_STEP_SUMMARY
|
||||||
|
fi
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue