Update GitHub Actions workflow for iOS build
This commit is contained in:
parent
73ed266994
commit
0c60a48e3a
1 changed files with 66 additions and 76 deletions
142
.github/workflows/main.yml
vendored
142
.github/workflows/main.yml
vendored
|
|
@ -1,95 +1,85 @@
|
||||||
name: Build iOS App
|
name: NodeShiftMusic iOS Build
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [main, master, develop]
|
branches: [main, master]
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
inputs:
|
|
||||||
profile:
|
|
||||||
description: 'Build profile'
|
|
||||||
required: true
|
|
||||||
default: 'preview'
|
|
||||||
type: choice
|
|
||||||
options:
|
|
||||||
- preview
|
|
||||||
- production
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build-ipa:
|
||||||
runs-on: ubuntu-latest
|
name: Build Unsigned IPA
|
||||||
|
runs-on: macos-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Setup Node.js
|
- name: Setup Node 20
|
||||||
uses: actions/setup-node@v4
|
uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: '24'
|
node-version: '20'
|
||||||
|
cache: 'npm'
|
||||||
|
|
||||||
- name: Install dependencies (Full Build)
|
- name: Install dependencies
|
||||||
run: npm install
|
run: npm ci
|
||||||
|
|
||||||
- name: Validate project
|
|
||||||
run: |
|
|
||||||
echo "Validating project structure..."
|
|
||||||
test -f app.json && echo "✓ app.json" || (echo "✗ Missing app.json" && exit 1)
|
|
||||||
test -f package.json && echo "✓ package.json" || (echo "✗ Missing package.json" && exit 1)
|
|
||||||
test -f eas.json && echo "✓ eas.json" || (echo "✓ eas.json will be created" && true)
|
|
||||||
|
|
||||||
- name: Check TypeScript
|
- name: Install CocoaPods
|
||||||
run: npx tsc --noEmit 2>&1 | head -20 || true
|
run: sudo gem install cocoapods --no-document
|
||||||
|
|
||||||
- name: Setup Expo CLI
|
- name: Expo prebuild
|
||||||
run: npm install -g expo-cli eas-cli
|
|
||||||
|
|
||||||
- name: Determine build profile
|
|
||||||
id: profile
|
|
||||||
run: |
|
|
||||||
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
|
|
||||||
PROFILE="${{ github.event.inputs.profile }}"
|
|
||||||
elif [ "${{ github.ref }}" = "refs/heads/develop" ]; then
|
|
||||||
PROFILE="preview"
|
|
||||||
else
|
|
||||||
PROFILE="production"
|
|
||||||
fi
|
|
||||||
echo "profile=$PROFILE" >> $GITHUB_OUTPUT
|
|
||||||
echo "Building with profile: $PROFILE"
|
|
||||||
|
|
||||||
- name: Build with EAS
|
|
||||||
env:
|
env:
|
||||||
EAS_TOKEN: ${{ secrets.EAS_TOKEN }}
|
EXPO_NO_DOTENV: 1
|
||||||
run: |
|
run: npx expo prebuild --platform ios --clean
|
||||||
PROFILE="${{ steps.profile.outputs.profile }}"
|
|
||||||
echo "🔨 Starting EAS build with profile: $PROFILE"
|
|
||||||
|
|
||||||
eas build \
|
|
||||||
--platform ios \
|
|
||||||
--profile "$PROFILE" \
|
|
||||||
--non-interactive \
|
|
||||||
--wait \
|
|
||||||
2>&1 | tee build.log
|
|
||||||
|
|
||||||
- name: Extract build info
|
- name: Install Pods
|
||||||
if: always()
|
working-directory: ios
|
||||||
|
run: pod install --repo-update
|
||||||
|
|
||||||
|
- name: Find workspace & scheme
|
||||||
|
id: xcode
|
||||||
run: |
|
run: |
|
||||||
echo "## Build Summary" >> $GITHUB_STEP_SUMMARY
|
WS=$(find ios -name "*.xcworkspace" -maxdepth 2 | head -1)
|
||||||
echo "" >> $GITHUB_STEP_SUMMARY
|
SCHEME=$(basename "$WS" .xcworkspace)
|
||||||
if grep -q "Successfully built" build.log; then
|
echo "workspace=$WS" >> $GITHUB_OUTPUT
|
||||||
echo "✅ **Status:** Success" >> $GITHUB_STEP_SUMMARY
|
echo "scheme=$SCHEME" >> $GITHUB_OUTPUT
|
||||||
echo "📲 **Download:** [EAS Dashboard](https://expo.dev)" >> $GITHUB_STEP_SUMMARY
|
echo "Workspace: $WS | Scheme: $SCHEME"
|
||||||
else
|
|
||||||
echo "❌ **Status:** Failed" >> $GITHUB_STEP_SUMMARY
|
- name: Build unsigned archive
|
||||||
echo "📋 **Profile:** ${{ steps.profile.outputs.profile }}" >> $GITHUB_STEP_SUMMARY
|
run: |
|
||||||
|
xcodebuild archive \
|
||||||
|
-workspace "${{ steps.xcode.outputs.workspace }}" \
|
||||||
|
-scheme "${{ steps.xcode.outputs.scheme }}" \
|
||||||
|
-configuration Release \
|
||||||
|
-sdk iphoneos \
|
||||||
|
-archivePath "$RUNNER_TEMP/NodeShiftMusic.xcarchive" \
|
||||||
|
CODE_SIGNING_REQUIRED=NO \
|
||||||
|
CODE_SIGN_IDENTITY="" \
|
||||||
|
CODE_SIGNING_ALLOWED=NO \
|
||||||
|
ENABLE_BITCODE=NO \
|
||||||
|
2>&1 | xcpretty || true
|
||||||
|
|
||||||
|
- name: Package IPA
|
||||||
|
run: |
|
||||||
|
APPS="$RUNNER_TEMP/NodeShiftMusic.xcarchive/Products/Applications"
|
||||||
|
mkdir -p Payload
|
||||||
|
cp -r "$APPS/"*.app Payload/
|
||||||
|
zip -qr NodeShiftMusic-unsigned.ipa Payload
|
||||||
|
rm -rf Payload
|
||||||
|
echo "IPA size: $(du -sh NodeShiftMusic-unsigned.ipa | cut -f1)"
|
||||||
|
|
||||||
|
- name: Upload IPA
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: NodeShiftMusic-unsigned
|
||||||
|
path: NodeShiftMusic-unsigned.ipa
|
||||||
|
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
|
fi
|
||||||
echo "" >> $GITHUB_STEP_SUMMARY
|
|
||||||
echo "**Branch:** ${{ github.ref }}" >> $GITHUB_STEP_SUMMARY
|
|
||||||
echo "**Commit:** ${{ github.sha }}" >> $GITHUB_STEP_SUMMARY
|
|
||||||
|
|
||||||
- name: Handle build failure
|
|
||||||
if: failure()
|
|
||||||
run: |
|
|
||||||
echo "❌ Build failed!"
|
|
||||||
echo "Check logs above or visit EAS Dashboard"
|
|
||||||
tail -50 build.log
|
|
||||||
exit 1
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue