88 lines
2.8 KiB
YAML
88 lines
2.8 KiB
YAML
name: Build Apple (macOS + iOS)
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
|
|
env:
|
|
http_proxy: http://127.0.0.1:7897
|
|
https_proxy: http://127.0.0.1:7897
|
|
HTTP_PROXY: http://127.0.0.1:7897
|
|
HTTPS_PROXY: http://127.0.0.1:7897
|
|
NO_PROXY: 192.168.120.110,localhost,127.0.0.1
|
|
|
|
jobs:
|
|
build-macos:
|
|
runs-on: mac-runner
|
|
steps:
|
|
- name: Checkout
|
|
run: |
|
|
git clone --depth 1 --branch main http://192.168.120.110:4000/AI_Team/habo.git .
|
|
- name: Verify Xcode
|
|
run: xcodebuild -version
|
|
- name: Install Flutter
|
|
run: |
|
|
if [ ! -d "$HOME/flutter" ]; then
|
|
git clone --depth 1 -b 3.35.7 https://github.com/flutter/flutter.git "$HOME/flutter"
|
|
fi
|
|
echo "$HOME/flutter/bin" >> $GITHUB_PATH
|
|
- name: Install deps
|
|
run: |
|
|
# Try brew install
|
|
brew install cocoapods 2>&1 || echo "brew install failed, trying gem"
|
|
# Verify installation
|
|
if ! command -v pod &> /dev/null; then
|
|
echo "pod not found, installing via gem"
|
|
gem install cocoapods -v 1.14.3
|
|
fi
|
|
# Verify again
|
|
which pod && pod --version
|
|
- name: Get dependencies
|
|
run: flutter pub get
|
|
- name: Build macOS
|
|
run: flutter build macos --release
|
|
- name: Create DMG
|
|
run: |
|
|
cd build/macos/Build/Products/Release
|
|
hdiutil create -volname Habo -srcfolder habo.app -ov -format UDZO habo.dmg
|
|
|
|
build-ios:
|
|
runs-on: mac-runner
|
|
steps:
|
|
- name: Checkout
|
|
run: |
|
|
git clone --depth 1 --branch main http://192.168.120.110:4000/AI_Team/habo.git .
|
|
- name: Verify Xcode
|
|
run: xcodebuild -version
|
|
- name: Install Flutter
|
|
run: |
|
|
if [ ! -d "$HOME/flutter" ]; then
|
|
git clone --depth 1 -b 3.35.7 https://github.com/flutter/flutter.git "$HOME/flutter"
|
|
fi
|
|
echo "$HOME/flutter/bin" >> $GITHUB_PATH
|
|
- name: Install deps
|
|
run: |
|
|
# Try brew install
|
|
brew install cocoapods 2>&1 || echo "brew install failed, trying gem"
|
|
# Verify installation
|
|
if ! command -v pod &> /dev/null; then
|
|
echo "pod not found, installing via gem"
|
|
gem install cocoapods -v 1.14.3
|
|
fi
|
|
# Add gem bin to PATH
|
|
echo "$(ruby -e 'puts Gem.user_dir')/bin" >> $GITHUB_PATH
|
|
# Verify again
|
|
which pod && pod --version
|
|
- name: Get dependencies
|
|
run: flutter pub get
|
|
- name: Install CocoaPods
|
|
run: cd ios && pod install
|
|
- name: Build iOS
|
|
run: flutter build ios --release --no-codesign --no-tree-shake-icons
|
|
- name: Package .app
|
|
run: |
|
|
mkdir -p payload
|
|
cp -r build/ios/iphoneos/Runner.app payload/
|
|
cd payload
|
|
zip -r ../Habo-iOS-no-sign.zip Runner.app
|