Replace setup-env action with reusable flutter-setup workflow; streamline CI configuration and enhance dependency management

This commit is contained in:
Dr.Blank 2025-04-04 23:01:18 +05:30
parent 0d2db7778a
commit d55ddc5b78
No known key found for this signature in database
GPG key ID: BA5F87FF0560C57B
3 changed files with 74 additions and 44 deletions

View file

@ -5,17 +5,23 @@ on:
branches:
- main
pull_request:
branches:
- main
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: setup env
uses: ./.github/actions/setup-env.yaml
name: Test
uses: ./.github/workflows/flutter-setup.yaml
secrets: inherit
with:
flutter-channel: stable
java-version: 17
steps:
# Debug: Echo current directory contents
- name: List root directory contents
run: |
@ -37,14 +43,21 @@ jobs:
echo "\nSubmodule details:"
git submodule foreach 'echo $path: && pwd && ls -la'
- name: Run flutter tests
- name: Run static analysis
run: flutter analyze
- name: Run tests
run: flutter test
build_android:
name: Build Android APKs
needs: test
runs-on: ubuntu-latest
steps:
- uses: ./.github/actions/setup-env.yaml
- uses: ./.github/workflows/flutter-setup.yaml
with:
flutter-channel: stable
java-version: 17
- name: Decode android/upload.jks
run: echo "${{ secrets.UPLOAD_KEYSTORE_JKS }}" | base64 --decode > android/upload.jks
@ -52,18 +65,16 @@ jobs:
- name: Decode android/key.properties
run: echo "${{ secrets.KEY_PROPERTIES }}" | base64 --decode > android/key.properties
- name: Set Up Java
uses: actions/setup-java@v3.12.0
with:
distribution: "oracle"
java-version: "17"
- name: Build Universal APK
run: flutter build apk --release
- name: Rename Universal APK
run: mv build/app/outputs/flutter-apk/{app-release,app-universal-release}.apk
- name: Upload Android APK Artifact
uses: actions/upload-artifact@v4
with:
name: release-apk
path: build/app/outputs/flutter-apk/*.apk
build_linux:
needs: test
runs-on: ubuntu-latest
@ -75,14 +86,9 @@ jobs:
- name: Build Linux AppImage
run: fastforge package --platform linux --targets deb
upload_artifacts:
needs: [build_android, build_linux]
runs-on: ubuntu-latest
steps:
- name: Upload Artifacts
- name: Upload deb Artifacts
uses: actions/upload-artifact@v4
with:
name: build-artifacts
path: |
build/app/outputs/flutter-apk/*.apk
dist/*/*.deb