made changes #5
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: Build Apk and Release | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| env: | |
| REGISTRY: ghcr.io | |
| IMAGE_NAME: ${{ github.repository }} | |
| jobs: | |
| apk: | |
| name: Flutter APK | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout source code | |
| uses: actions/checkout@v4 | |
| - name: Set up Java (required for Android builds) | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: temurin | |
| java-version: '25' | |
| - name: Set up Flutter | |
| uses: subosito/flutter-action@v2 | |
| with: | |
| channel: stable | |
| cache: true | |
| - name: Install Flutter dependencies | |
| working-directory: mobile | |
| run: flutter pub get | |
| - name: Run Flutter analyze | |
| working-directory: mobile | |
| run: flutter analyze --no-fatal-infos | |
| - name: Build release APK | |
| working-directory: mobile | |
| run: flutter build apk --release --split-per-abi | |
| - name: Rename APKs with version tag | |
| run: | | |
| mv mobile/build/app/outputs/flutter-apk/app-armeabi-v7a-release.apk mobile/build/app/outputs/flutter-apk/elephant-${{ github.ref_name }}-armeabi-v7a.apk | |
| mv mobile/build/app/outputs/flutter-apk/app-arm64-v8a-release.apk mobile/build/app/outputs/flutter-apk/elephant-${{ github.ref_name }}-arm64-v8a.apk | |
| mv mobile/build/app/outputs/flutter-apk/app-x86_64-release.apk mobile/build/app/outputs/flutter-apk/elephant-${{ github.ref_name }}-x86_64.apk | |
| - name: Create or update GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: ${{ github.ref_name }} | |
| name: Elephant ${{ github.ref_name }} | |
| draft: false | |
| prerelease: false | |
| generate_release_notes: true | |
| files: mobile/build/app/outputs/flutter-apk/elephant-${{ github.ref_name }}-*.apk | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |