2626 - patch
2727 - minor
2828 - major
29- include_android :
30- description : " Include Android build in this release"
31- required : false
32- default : true
33- type : boolean
3429
3530concurrency :
3631 group : main-release
@@ -188,7 +183,7 @@ jobs:
188183 run : |
189184 echo "📦 Installing system dependencies for validation..."
190185 sudo apt-get update
191- sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf libglib2.0-dev
186+ sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf libglib2.0-dev curl wget unzip
192187 echo "✅ System dependencies installed"
193188
194189 - name : Run comprehensive validation
@@ -243,7 +238,16 @@ jobs:
243238 VALIDATION_PASSED="false"
244239 fi
245240
246- # 7. Check Rust/Cargo configuration
241+ # 7. Setup JRE for Tabula (required for Rust build)
242+ echo "🔧 Setting up JRE for Tabula..."
243+ if ! bash src-tauri/scripts/setup-build-jre.sh; then
244+ VALIDATION_ERRORS="${VALIDATION_ERRORS}JRE setup failed. "
245+ VALIDATION_PASSED="false"
246+ else
247+ echo "✅ JRE setup completed"
248+ fi
249+
250+ # 8. Check Rust/Cargo configuration
247251 echo "🦀 Validating Rust configuration..."
248252 cd src-tauri
249253
@@ -297,6 +301,7 @@ jobs:
297301 title : " chore: release version packages"
298302 commit : " chore: release version packages"
299303 createGithubReleases : false
304+ cwd : app
300305 env :
301306 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
302307
@@ -333,6 +338,7 @@ jobs:
333338 pnpm run sync-versions
334339
335340 # Check if there are any changes to commit
341+ cd ..
336342 if ! git diff --quiet; then
337343 git config user.name "github-actions[bot]"
338344 git config user.email "github-actions[bot]@users.noreply.github.com"
@@ -347,12 +353,14 @@ jobs:
347353 - name : Get version and create tag
348354 id : version
349355 run : |
356+ cd app
350357 VERSION=$(node -p "require('./package.json').version")
351358 TAG="v$VERSION"
352359
353360 echo "version=$VERSION" >> $GITHUB_OUTPUT
354361 echo "tag=$TAG" >> $GITHUB_OUTPUT
355362
363+ cd ..
356364 # Configure git
357365 git config user.name "github-actions[bot]"
358366 git config user.email "github-actions[bot]@users.noreply.github.com"
@@ -373,23 +381,11 @@ jobs:
373381 echo "ℹ️ Tag $TAG already exists locally"
374382 fi
375383
376- # Step 5: Build Android (if requested)
377- build-android :
378- name : " Build Android"
379- needs : [check-release, pre-release-validation, prepare-release]
380- if : needs.check-release.outputs.should_release == 'true' && needs.pre-release-validation.outputs.validation_passed == 'true' && (github.event.inputs.include_android == 'true' || github.event.inputs.include_android == null)
381- uses : ./.github/workflows/android-release.yml
382- with :
383- version : ${{ needs.prepare-release.outputs.version }}
384- force_build : true
385- secrets : inherit
386-
387- # Step 6: Build and release desktop
384+ # Step 5: Build and release desktop
388385 build-and-release :
389386 name : " Build & Release"
390- needs :
391- [check-release, pre-release-validation, prepare-release, build-android]
392- if : needs.check-release.outputs.should_release == 'true' && needs.pre-release-validation.outputs.validation_passed == 'true' && always() && (needs.build-android.result == 'success' || needs.build-android.result == 'skipped')
387+ needs : [check-release, pre-release-validation, prepare-release]
388+ if : needs.check-release.outputs.should_release == 'true' && needs.pre-release-validation.outputs.validation_passed == 'true'
393389 permissions :
394390 contents : write
395391 strategy :
@@ -434,7 +430,7 @@ jobs:
434430 if : matrix.platform == 'ubuntu-22.04'
435431 run : |
436432 sudo apt-get update
437- sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf
433+ sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf curl wget unzip
438434
439435 - name : Install create-dmg (macOS)
440436 if : matrix.platform == 'macos-latest'
@@ -492,7 +488,7 @@ jobs:
492488 uses : actions/cache@v4
493489 with :
494490 path : |
495- node_modules
491+ app/ node_modules
496492 key : ${{ runner.os }}-node-${{ hashFiles('**/pnpm-lock.yaml') }}
497493 restore-keys : |
498494 ${{ runner.os }}-node-
@@ -501,25 +497,42 @@ jobs:
501497 uses : actions/cache@v4
502498 with :
503499 path : |
504- dist
505- src-tauri/target/release
500+ app/ dist
501+ app/ src-tauri/target/release
506502 key : ${{ runner.os }}-${{ matrix.build_name }}-build-${{ hashFiles('**/package.json', '**/Cargo.toml', '**/src/**') }}
507503 restore-keys : |
508504 ${{ runner.os }}-${{ matrix.build_name }}-build-
509505
506+ - name : Cache JRE for Tabula
507+ uses : actions/cache@v4
508+ with :
509+ path : |
510+ app/src-tauri/resources/build-jre
511+ key : ${{ runner.os }}-${{ matrix.target }}-jre-${{ hashFiles('app/src-tauri/scripts/setup-build-jre.sh') }}
512+ restore-keys : |
513+ ${{ runner.os }}-${{ matrix.target }}-jre-
514+
510515 - name : Install frontend dependencies
511516 run : pnpm install --frozen-lockfile
512517
513518 - name : Build frontend
514519 run : pnpm build
515520
521+ - name : Setup JRE for Tabula
522+ shell : bash
523+ run : |
524+ echo "🔧 Setting up JRE for Tabula PDF processing..."
525+ bash src-tauri/scripts/setup-build-jre.sh
526+ echo "✅ JRE setup completed"
527+
516528 - name : Extract changelog for release
517529 id : changelog
518530 shell : bash
519531 continue-on-error : false
520532 run : |
521533 set +e # Disable exit on error for this script
522534 VERSION="${{ needs.prepare-release.outputs.version }}"
535+ cd app
523536
524537 if [ -f "CHANGELOG.md" ]; then
525538 # Extract the changelog section for the current version
@@ -637,14 +650,6 @@ jobs:
637650 id : timestamp
638651 run : echo "build_time=$(date -u +"%Y-%m-%d %H:%M UTC")" >> $GITHUB_OUTPUT
639652
640- - name : Download Android artifacts (if available)
641- if : needs.build-android.result == 'success'
642- uses : actions/download-artifact@v4
643- with :
644- name : mpesa2csv-v${{ needs.prepare-release.outputs.version }}
645- path : ./android-artifacts/
646- continue-on-error : true
647-
648653 - name : Build and release Tauri app
649654 id : tauri-action
650655 continue-on-error : true
@@ -723,22 +728,20 @@ jobs:
723728 | **macOS** | Intel x64 | [📥 Download .dmg](https://github.com/DavidAmunga/mpesa2csv/releases/download/${{ needs.prepare-release.outputs.tag }}/mpesa2csv_${{ needs.prepare-release.outputs.version }}_x64.dmg) | Open DMG and drag to Applications |
724729 | **Linux** | x64 (Ubuntu/Debian) | [📥 Download .deb](https://github.com/DavidAmunga/mpesa2csv/releases/download/${{ needs.prepare-release.outputs.tag }}/mpesa2csv_${{ needs.prepare-release.outputs.version }}_amd64.deb) | `sudo dpkg -i mpesa2csv_*.deb` |
725730 | **Linux** | x64 (Portable) | [📥 Download .AppImage](https://github.com/DavidAmunga/mpesa2csv/releases/download/${{ needs.prepare-release.outputs.tag }}/mpesa2csv_${{ needs.prepare-release.outputs.version }}_amd64.AppImage) | `chmod +x mpesa2csv_*.AppImage && ./mpesa2csv_*.AppImage` |
726- ${{ needs.build-android.result == 'success' && format('| **Android** | ARM64 | [📥 Download .apk](https://github.com/DavidAmunga/mpesa2csv/releases/download/{0}/mpesa2csv-v{1}-universal-release.apk) | Enable "Install from unknown sources" and install', needs.prepare-release.outputs.tag, needs.prepare-release.outputs.version) || '' }}
727731
728732 ### 📊 Release Metadata
729733
730734 - **Version**: `${{ needs.prepare-release.outputs.version }}`
731735 - **Build Date**: `${{ steps.timestamp.outputs.build_time }}`
732736 - **Total Changes**: ${{ steps.changelog.outputs.total_changes }}
733- - **Platforms**: Windows, macOS (Intel + Apple Silicon), Linux${{ needs.build-android.result == 'success' && ', Android' || '' }}
737+ - **Platforms**: Windows, macOS (Intel + Apple Silicon), Linux
734738 ${{ steps.changelog.outputs.breaking > 0 && format('- **Breaking Changes**: {0}', steps.changelog.outputs.breaking) || '' }}
735739
736740 ### 🔍 System Requirements
737741
738742 - **Windows**: Windows 10 version 1903 or later
739743 - **macOS**: macOS 10.15 Catalina or later
740744 - **Linux**: Modern distribution with GTK 3.24+ and WebKit2GTK 4.1+
741- ${{ needs.build-android.result == 'success' && '- **Android**: Android 7.0 (API level 24) or later' || '' }}
742745
743746 ### 🔄 Auto-Update
744747
@@ -752,38 +755,7 @@ jobs:
752755 env :
753756 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
754757
755- - name : Upload Android artifacts to release
756- if : needs.build-android.result == 'success' && matrix.platform == 'ubuntu-22.04'
757- run : |
758- if [ -d "./android-artifacts" ]; then
759- echo "📱 Uploading Android artifacts to release..."
760- # Move Android artifacts to current directory for upload
761- find ./android-artifacts -name "*.apk" -o -name "*.aab" | while read file; do
762- if [ -f "$file" ]; then
763- filename=$(basename "$file")
764- cp "$file" "./$filename"
765- echo "✅ Prepared $filename for release"
766- fi
767- done
768-
769- # Upload to GitHub release using gh CLI
770- if command -v gh &> /dev/null; then
771- for file in *.apk *.aab; do
772- if [ -f "$file" ]; then
773- echo "📤 Uploading $file to release..."
774- gh release upload "${{ needs.prepare-release.outputs.tag }}" "$file" --clobber || echo "⚠️ Failed to upload $file"
775- fi
776- done
777- else
778- echo "⚠️ GitHub CLI not available, Android artifacts not uploaded to release"
779- fi
780- else
781- echo "ℹ️ No Android artifacts found to upload"
782- fi
783- env :
784- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
785-
786- # Step 7: Generate and upload updater JSON
758+ # Step 6: Generate and upload updater JSON
787759 generate-updater-json :
788760 name : " Generate Updater JSON"
789761 needs :
@@ -865,7 +837,7 @@ jobs:
865837 env :
866838 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
867839
868- # Step 8 : Create release branch for hotfixes
840+ # Step 7 : Create release branch for hotfixes
869841 create-release-branch :
870842 name : " Create Release Branch"
871843 needs :
@@ -883,15 +855,14 @@ jobs:
883855 max_branches : 5
884856 secrets : inherit
885857
886- # Step 9 : Notify about release completion
858+ # Step 8 : Notify about release completion
887859 notify-completion :
888860 name : " Release Complete"
889861 runs-on : ubuntu-latest
890862 needs :
891863 [
892864 pre-release-validation,
893865 prepare-release,
894- build-android,
895866 build-and-release,
896867 generate-updater-json,
897868 create-release-branch,
@@ -902,7 +873,6 @@ jobs:
902873 run : |
903874 echo "🎉 Release ${{ needs.prepare-release.outputs.tag }} completed!"
904875 echo "✅ Desktop binaries built and published"
905- ${{ needs.build-android.result == 'success' && 'echo "✅ Android APK/AAB built and published"' || 'echo "ℹ️ Android build skipped or failed"' }}
906876 echo "✅ Release branch created for hotfixes"
907877 echo "🔗 View release: https://github.com/${{ github.repository }}/releases/tag/${{ needs.prepare-release.outputs.tag }}"
908878
@@ -915,7 +885,6 @@ jobs:
915885 - [x] Version files synced
916886 - [x] Git tag created: ${{ needs.prepare-release.outputs.tag }}
917887 - [x] Desktop binaries built for all platforms
918- ${{ needs.build-android.result == 'success' && '- [x] Android APK/AAB built and published' || '- [ ] Android build skipped or failed' }}
919888 - [x] GitHub release created
920889 - [x] Updater JSON generated
921890 - [x] Release branch created for hotfixes
@@ -924,7 +893,6 @@ jobs:
924893 - **Release Reason**: ${{ needs.check-release.outputs.release_reason }}
925894 - **Validation**: ✅ Passed
926895 - **Desktop Builds**: ✅ Success
927- - **Android Build**: ${{ needs.build-android.result == 'success' && '✅ Success' || '❌ Failed/Skipped' }}
928896 - **Release Creation**: ✅ Success
929897
930898 ## 🔗 Links
@@ -938,7 +906,6 @@ jobs:
938906 - macOS Intel: [Download .dmg](https://github.com/${{ github.repository }}/releases/download/${{ needs.prepare-release.outputs.tag }}/mpesa2csv_${{ needs.prepare-release.outputs.version }}_x64.dmg)
939907 - Linux x64: [Download .deb](https://github.com/${{ github.repository }}/releases/download/${{ needs.prepare-release.outputs.tag }}/mpesa2csv_${{ needs.prepare-release.outputs.version }}_amd64.deb)
940908 - Linux Portable: [Download .AppImage](https://github.com/${{ github.repository }}/releases/download/${{ needs.prepare-release.outputs.tag }}/mpesa2csv_${{ needs.prepare-release.outputs.version }}_amd64.AppImage)
941- ${{ needs.build-android.result == 'success' && format('- Android: [Download .apk](https://github.com/{0}/releases/download/{1}/mpesa2csv-v{2}-universal-release.apk)', github.repository, needs.prepare-release.outputs.tag, needs.prepare-release.outputs.version) || '' }}
942909
943910 ---
944911
0 commit comments