Some checks failed
Build & Test / test (push) Failing after 45s
Build & Test / build-android (push) Has been skipped
Build & Test / build-linux (push) Has been skipped
Build & Test / build-macos (push) Has been skipped
Build & Test / build-ios (push) Has been skipped
Build & Test / build-windows (push) Has been skipped
147 lines
4.0 KiB
YAML
147 lines
4.0 KiB
YAML
name: Build & Test
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
branches: [main]
|
|
|
|
jobs:
|
|
test:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Setup Flutter
|
|
uses: subosito/flutter-action@v2
|
|
with:
|
|
flutter-version: '3.35.7'
|
|
- name: Get dependencies
|
|
run: flutter pub get
|
|
- name: Analyze
|
|
run: flutter analyze
|
|
- name: Run tests
|
|
run: flutter test
|
|
|
|
build-android:
|
|
needs: test
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Setup Flutter
|
|
uses: subosito/flutter-action@v2
|
|
with:
|
|
flutter-version: '3.35.7'
|
|
- name: Setup Java
|
|
uses: actions/setup-java@v4
|
|
with:
|
|
distribution: 'temurin'
|
|
java-version: '17'
|
|
- name: Get dependencies
|
|
run: flutter pub get
|
|
- name: Build APK
|
|
run: flutter build apk --release --split-per-abi --no-tree-shake-icons
|
|
- name: Upload APK
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: habo-apks
|
|
path: build/app/outputs/flutter-apk/
|
|
|
|
build-linux:
|
|
needs: test
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Setup Flutter
|
|
uses: subosito/flutter-action@v2
|
|
with:
|
|
flutter-version: '3.35.7'
|
|
- name: Install Linux deps
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y ninja-build clang cmake pkg-config libgtk-3-dev libblkid-dev liblzma-dev libasound2-dev
|
|
- name: Get dependencies
|
|
run: flutter pub get
|
|
- name: Build
|
|
run: flutter build linux --release
|
|
- name: Upload artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: habo-linux
|
|
path: build/linux/x64/release/bundle/
|
|
|
|
build-macos:
|
|
needs: test
|
|
runs-on: mac-runner
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Setup Flutter
|
|
uses: subosito/flutter-action@v2
|
|
with:
|
|
flutter-version: '3.35.7'
|
|
- name: Install macOS deps
|
|
run: |
|
|
brew install cocoapods
|
|
- 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
|
|
- name: Upload artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: habo-macos
|
|
path: build/macos/Build/Products/Release/habo.dmg
|
|
|
|
build-ios:
|
|
needs: test
|
|
runs-on: mac-runner
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Setup Flutter
|
|
uses: subosito/flutter-action@v2
|
|
with:
|
|
flutter-version: '3.35.7'
|
|
- 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
|
|
- name: Upload iOS artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: habo-ios-no-sign
|
|
path: Habo-iOS-no-sign.zip
|
|
|
|
build-windows:
|
|
needs: test
|
|
runs-on: windows-runner
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Setup Flutter
|
|
uses: subosito/flutter-action@v2
|
|
with:
|
|
flutter-version: '3.35.7'
|
|
- name: Get dependencies
|
|
run: flutter pub get
|
|
- name: Build Windows
|
|
run: flutter build windows --release
|
|
- name: Create ZIP
|
|
run: |
|
|
cd build/windows/x64/runner/Release
|
|
Compress-Archive -Path * -DestinationPath habo-windows.zip
|
|
- name: Upload artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: habo-windows
|
|
path: build/windows/x64/runner/Release/habo-windows.zip
|