123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135 |
- name: CI
- on:
- push:
- branches: [ master , main]
- pull_request:
- branches: [ master , main]
- jobs:
- build:
- strategy:
- matrix:
- os: [ubuntu-latest, windows-latest, macos-latest]
- runs-on: ${{matrix.os}}
- steps:
- - uses: actions/checkout@v4
- - name: Setup Java JDK
- uses: actions/setup-java@v2
- with:
- distribution: 'adopt'
- java-version: "8.x"
- # - name: Setup gradle
- # uses: eskatos/gradle-command-action@v1
- # with:
- # gradle-version: 6.5
- - name: Flutter action
- uses: subosito/flutter-action@v1.5.3
- with:
- channel: "stable"
- flutter-version: "3.0.5"
-
- - name: Cache Dependencies
- id: cache
- uses: actions/cache@v2
- with:
- path: |
- ~/.gradle/caches
- ~/.gradle/wrapper
- Pods
- key: |
- ${{runner.OS}}-gradle-caches-${{ hashFiles('pubspec.lock') }}
- ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock') }}
- restore-keys: |
- ${{ runner.os }}-pods-
- ${{ runner.os }}-gradle-
- - name: Install Dependencies
- if: steps.cache.outputs.cache-hit != 'true'
- run: flutter pub get
- - name: Build apk
- if: ${{ runner.os == 'Linux' }}
- run: flutter build apk --debug --split-per-abi
- - name: Build ios
- if: ${{ runner.os == 'macOS' }}
- run: |
- sudo xcode-select -s /Applications/Xcode_12.3.app
- flutter build ios --release --no-codesign
- cd build/ios/iphoneos
- mkdir Payload
- cd Payload
- ln -s ../Runner.app
- cd ..
- zip -r app.ipa Payload
- - name: Build Web
- if: ${{runner.os == 'Linux'}}
- run: |
- flutter build web
- cd build/web
- zip -r web-app.zip .
- - name: Build exe
- if: ${{ runner.os == 'Windows'}}
- run: |
- flutter config --enable-windows-desktop
- flutter build windows
- - name: Set Up XCode
- if: ${{ runner.os == 'macOS'}}
- uses: devbotsxyz/xcode-select@v1.1.0
- - name: Build mac
- if: ${{ runner.os == 'macOS'}}
- run: |
- flutter config --enable-macos-desktop
- flutter build macos
-
- - name: Build linux
- if: ${{ runner.os == 'Linux' }}
- run: |
- sudo apt-get update && sudo apt-get install clang cmake ninja-build pkg-config libgtk-3-dev
- flutter config --enable-linux-desktop
- flutter build linux
- # output some file:
- - name: artifact
- uses: actions/upload-artifact@v4
- with:
- name: ${{runner.OS}}-artifact
- path: |
- # build/app/outputs/flutter-apk/**/*.apk
- build/app/outputs/flutter-apk/app.apk
- build/ios/**/*.ipa
- build/web/web-app.zip
- build/windows/runner/Release/
- # build/
-
- # - name: Deploy iOS Beta to TestFlight via Fastlane
- # uses: maierj/fastlane-action@v2.0.1
- # with:
- # lane: beta
- # subdirectory: ios
- # env:
- # APP_STORE_CONNECT_TEAM_ID: '${{ secrets.APP_STORE_CONNECT_TEAM_ID }}'
- # DEVELOPER_APP_ID: '${{ secrets.DEVELOPER_APP_ID }}'
- # DEVELOPER_APP_IDENTIFIER: '${{ secrets.DEVELOPER_APP_IDENTIFIER }}'
- # DEVELOPER_PORTAL_TEAM_ID: '${{ secrets.DEVELOPER_PORTAL_TEAM_ID }}'
- # FASTLANE_APPLE_ID: '${{ secrets.FASTLANE_APPLE_ID }}'
- # FASTLANE_APPLE_APPLICATION_SPECIFIC_PASSWORD: '${{ secrets.FASTLANE_APPLE_APPLICATION_SPECIFIC_PASSWORD }}'
- # MATCH_PASSWORD: '${{ secrets.MATCH_PASSWORD }}'
- # GIT_AUTHORIZATION: '${{ secrets.GIT_AUTHORIZATION }}'
- # PROVISIONING_PROFILE_SPECIFIER: '${{ secrets.PROVISIONING_PROFILE_SPECIFIER }}'
- # TEMP_KEYCHAIN_PASSWORD: '${{ secrets.TEMP_KEYCHAIN_PASSWORD }}'
- # TEMP_KEYCHAIN_USER: '${{ secrets.TEMP_KEYCHAIN_USER }}'
-
- # - name: Release Apps
- # uses: ncipollo/release-action@v1
- # with:
- # tag: ${{ env.APP_VERSION }}
- # name: ${{ env.APP_VERSION }}
- # token: ${{ secrets.GITHUB_TOKEN }}
- # artifacts: 'build/app/outputs/apk/release/*.apk,build/ios/iphoneos/app.ipa,build/web/web-app.zip'
|