107 lines
3.4 KiB
YAML
107 lines
3.4 KiB
YAML
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 --ignore-scripts
|
|
npm install react-native-svg --legacy-peer-deps --ignore-scripts
|
|
|
|
- name: Hard Reset app.json
|
|
run: |
|
|
cat << 'EOF' > app.json
|
|
{
|
|
"expo": {
|
|
"name": "BurmaldaMusic",
|
|
"slug": "nodeshiftmusicburmalda",
|
|
"version": "1.0.1",
|
|
"orientation": "portrait",
|
|
"icon": "./assets/icon.png",
|
|
"userInterfaceStyle": "light",
|
|
"ios": {
|
|
"supportsTablet": true,
|
|
"bundleIdentifier": "com.nodeshift.burmaldamusic",
|
|
"config": {
|
|
"usesNonExemptEncryption": false
|
|
}
|
|
},
|
|
"plugins": [
|
|
"./node_modules/react-native-track-player/app.plugin.js"
|
|
]
|
|
}
|
|
}
|
|
EOF
|
|
|
|
- name: Patch Track Player
|
|
run: |
|
|
TARGET_DIR="node_modules/react-native-track-player/lib/src"
|
|
if [ -d "$TARGET_DIR" ]; then
|
|
cp "$TARGET_DIR/trackPlayer.js" "$TARGET_DIR/trackPlayer.js" 2>/dev/null || \
|
|
cp "$TARGET_DIR/trackPlayer" "$TARGET_DIR/trackPlayer.js" 2>/dev/null || true
|
|
fi
|
|
|
|
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: Expo prebuild
|
|
run: npx expo prebuild --platform ios --clean --no-install
|
|
env:
|
|
EXPO_NO_DOTENV: 1
|
|
|
|
- name: Install CocoaPods
|
|
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)
|
|
|
|
xcodebuild build \
|
|
-workspace "$WORKSPACE_PATH" \
|
|
-scheme "$SCHEME_NAME" \
|
|
-configuration Release \
|
|
-sdk iphoneos \
|
|
-derivedDataPath "$RUNNER_TEMP/DerivedData" \
|
|
CODE_SIGNING_REQUIRED=NO \
|
|
CODE_SIGNING_ALLOWED=NO \
|
|
CODE_SIGN_IDENTITY="" \
|
|
ENABLE_BITCODE=NO \
|
|
| xcpretty
|
|
|
|
- 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_final.ipa Payload
|
|
|
|
- name: Upload IPA
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: Burmalda-IPA
|
|
path: burmalda_final.ipa
|