Updated #3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: flutter-build | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build-android: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-java@v1 | |
with: | |
distribution: 'adopt' | |
java-version: '11' | |
- name: Set up Flutter | |
uses: subosito/flutter-action@v2 | |
with: | |
channel: stable | |
flutter-version: '3.22.3' | |
- name: Install dependencies | |
run: flutter pub get | |
- name: Build APK | |
run: flutter build apk --release | |
- name: Archive production artifacts | |
uses: actions/upload-artifact@v2 | |
with: | |
name: squarecloudapp | |
path: build/app/outputs/flutter-apk/app-release.apk | |
build-ios: | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Flutter | |
uses: subosito/flutter-action@v2 | |
with: | |
flutter-version: '3.22.3' | |
- name: Install dependencies | |
run: flutter pub get | |
- name: Build iOS | |
run: flutter build ios --release --no-codesign | |
- name: Archive production artifacts | |
run: mkdir build/ios/iphoneos/Payload | |
- name: Copy .app to Payload | |
run: cp -r build/ios/iphoneos/Runner.app build/ios/iphoneos/Payload | |
- name: Zip .app | |
uses: vimtor/[email protected] | |
with: | |
files: build/ios/iphoneos/Payload | |
dest: build/ios/iphoneos/squarecloud.ipa | |
- name: Archive production artifacts | |
uses: actions/upload-artifact@v2 | |
with: | |
name: squarecloudapp | |
path: build/ios/iphoneos/squarecloud.ipa |