Android Build #4
This file contains hidden or 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: Android Build | |
| on: | |
| # push: | |
| # branches: [ main ] | |
| # pull_request: | |
| workflow_dispatch: | |
| workflow_call: | |
| jobs: | |
| build-android: | |
| name: Build Android | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| - name: Setup Flutter | |
| uses: flutter-actions/setup-flutter@v4 | |
| with: | |
| channel: stable | |
| version: latest | |
| - name: Install dependencies | |
| run: flutter pub get | |
| - name: Build Android APK | |
| run: flutter build apk --release | |
| - name: Prepare and rename artifacts | |
| run: | | |
| VERSION=$(grep '^version:' pubspec.yaml | cut -d ' ' -f 2) | |
| mkdir deploy_out | |
| cp build/app/outputs/flutter-apk/app-release.apk "deploy_out/lsfusion-client-$VERSION.apk" | |
| - name: Upload to CDN via FTP | |
| uses: sand4rt/ftp-deployer@v1.8 | |
| with: | |
| host: ${{ secrets.SFTP_HOST }} | |
| username: ${{ secrets.SFTP_USERNAME }} | |
| password: ${{ secrets.SFTP_PASSWORD }} | |
| port: 21 | |
| local_folder: deploy_out/ | |
| remote_folder: flutter/android/ | |
| cleanup: false | |
| - name: Upload Android APK | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: android-apk | |
| path: deploy_out/* |