Refactor GitHub Actions workflow for iOS build
Updated Node setup and dependency installation steps. Removed unnecessary permission fix and disk space cleanup steps.
This commit is contained in:
parent
698a3cf1ac
commit
3702f91441
1 changed files with 8 additions and 22 deletions
30
.github/workflows/main.yml
vendored
30
.github/workflows/main.yml
vendored
|
|
@ -17,32 +17,28 @@ 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: npm install react-native-svg && npm install
|
run: |
|
||||||
|
npm install --legacy-peer-deps
|
||||||
- name: Fix permissions
|
# Если react-native-svg критичен и его нет в package.json, лучше добавь его туда.
|
||||||
run: chmod -R +x node_modules/.bin/
|
# Но если нужно здесь:
|
||||||
|
npm install react-native-svg --legacy-peer-deps
|
||||||
|
|
||||||
- name: Fix PNG assets
|
- name: Fix PNG assets
|
||||||
run: |
|
run: |
|
||||||
find assets -name "*.png" | while read f; do
|
find assets -name "*.png" -exec sips -s format png {} --out {} \; 2>/dev/null || true
|
||||||
sips -s format png "$f" --out "$f"
|
|
||||||
done
|
|
||||||
|
|
||||||
- name: Expo prebuild
|
- name: Expo prebuild
|
||||||
run: npx expo prebuild --platform ios --clean
|
run: npx expo prebuild --platform ios --clean
|
||||||
env:
|
env:
|
||||||
EXPO_NO_DOTENV: 1
|
EXPO_NO_DOTENV: 1
|
||||||
|
|
||||||
- name: Free disk space
|
|
||||||
run: rm -rf ~/Library/Developer/Xcode/DerivedData
|
|
||||||
|
|
||||||
- name: Build unsigned app
|
- name: Build unsigned app
|
||||||
run: |
|
run: |
|
||||||
WORKSPACE=$(find ios -name "*.xcworkspace" -type d | head -1)
|
WORKSPACE=$(find ios -name "*.xcworkspace" -type d | head -1)
|
||||||
SCHEME=$(basename "$WORKSPACE" .xcworkspace)
|
SCHEME=$(basename "$WORKSPACE" .xcworkspace)
|
||||||
echo "Workspace: $WORKSPACE | Scheme: $SCHEME"
|
|
||||||
xcodebuild build \
|
xcodebuild build \
|
||||||
-workspace "$WORKSPACE" \
|
-workspace "$WORKSPACE" \
|
||||||
-scheme "$SCHEME" \
|
-scheme "$SCHEME" \
|
||||||
|
|
@ -55,17 +51,7 @@ jobs:
|
||||||
|
|
||||||
- name: Package IPA
|
- name: Package IPA
|
||||||
run: |
|
run: |
|
||||||
APP_PATH=$(find "$RUNNER_TEMP/DerivedData/Build/Products" -name "*.app" -type d 2>/dev/null | grep -v "\.xctest" | head -1)
|
APP_PATH=$(find "$RUNNER_TEMP/DerivedData/Build/Products" -name "*.app" -type d | grep -v "\.xctest" | head -1)
|
||||||
if [ -z "$APP_PATH" ]; then
|
|
||||||
APP_PATH=$(find /Users/runner -maxdepth 8 -name "*.app" -type d 2>/dev/null \
|
|
||||||
| grep -v "\.xctest" \
|
|
||||||
| grep -v "Xcode.app" \
|
|
||||||
| grep -v "CoreSimulator" \
|
|
||||||
| grep -v "node_modules" \
|
|
||||||
| grep -v "Cellar" \
|
|
||||||
| head -1)
|
|
||||||
fi
|
|
||||||
echo "APP_PATH: $APP_PATH"
|
|
||||||
if [ -z "$APP_PATH" ]; then echo "ERROR: .app not found"; exit 1; fi
|
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 "$APP_PATH" Payload/
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue