@@ -463,6 +463,7 @@ jobs:
463463
464464 - name : Build and release Tauri app
465465 uses : tauri-apps/tauri-action@v0
466+ id : tauri-action
466467 env :
467468 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
468469 TAURI_SIGNING_PRIVATE_KEY : ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
@@ -508,7 +509,6 @@ jobs:
508509 | **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` |
509510 | **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` |
510511 ${{ 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) || '' }}
511- ${{ needs.build-android.result == 'success' && format('| **Android** | ARM64 | [📥 Download .aab](https://github.com/DavidAmunga/mpesa2csv/releases/download/{0}/mpesa2csv-v{1}-universal-release.aab) | For Google Play Store or enterprise distribution', needs.prepare-release.outputs.tag, needs.prepare-release.outputs.version) || '' }}
512512
513513 ### 📊 Release Metadata
514514
@@ -567,23 +567,90 @@ jobs:
567567 env :
568568 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
569569
570- # Step 6: Create release branch for hotfixes
570+ # Step 6: Generate and upload updater JSON
571+ generate-updater-json :
572+ name : " Generate Updater JSON"
573+ needs : [check-release, prepare-release, build-and-release]
574+ if : needs.check-release.outputs.should_release == 'true'
575+ runs-on : ubuntu-latest
576+ permissions :
577+ contents : write
578+ steps :
579+ - uses : actions/checkout@v4
580+
581+ - name : Generate and upload latest.json
582+ run : |
583+ echo "🔄 Generating latest.json for Tauri updater..."
584+
585+ VERSION="${{ needs.prepare-release.outputs.version }}"
586+ TAG="${{ needs.prepare-release.outputs.tag }}"
587+
588+ # Create the latest.json file
589+ cat > latest.json << EOF
590+ {
591+ "version": "$VERSION",
592+ "notes": "Update to version $VERSION. See full release notes at https://github.com/${{ github.repository }}/releases/tag/$TAG",
593+ "pub_date": "$(date -u +"%Y-%m-%dT%H:%M:%S.000Z")",
594+ "platforms": {
595+ "darwin-aarch64": {
596+ "signature": "",
597+ "url": "https://github.com/${{ github.repository }}/releases/download/$TAG/mpesa2csv_${VERSION}_aarch64.app.tar.gz"
598+ },
599+ "darwin-x86_64": {
600+ "signature": "",
601+ "url": "https://github.com/${{ github.repository }}/releases/download/$TAG/mpesa2csv_${VERSION}_x64.app.tar.gz"
602+ },
603+ "linux-x86_64": {
604+ "signature": "",
605+ "url": "https://github.com/${{ github.repository }}/releases/download/$TAG/mpesa2csv_${VERSION}_amd64.AppImage.tar.gz"
606+ },
607+ "windows-x86_64": {
608+ "signature": "",
609+ "url": "https://github.com/${{ github.repository }}/releases/download/$TAG/mpesa2csv_${VERSION}_x64-setup.nsis.zip"
610+ }
611+ }
612+ }
613+ EOF
614+
615+ echo "📄 Generated latest.json:"
616+ cat latest.json
617+
618+ # Upload to the release
619+ echo "📤 Uploading latest.json to release $TAG..."
620+ gh release upload "$TAG" latest.json --clobber
621+ echo "✅ latest.json uploaded successfully"
622+
623+ # Verify the file is accessible
624+ echo "🔍 Verifying latest.json is accessible..."
625+ sleep 5 # Give GitHub a moment to process
626+ curl -f "https://github.com/${{ github.repository }}/releases/download/$TAG/latest.json" || echo "⚠️ latest.json not yet accessible"
627+ env :
628+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
629+
630+ # Step 7: Create release branch for hotfixes
571631 create-release-branch :
572632 name : " Create Release Branch"
573- needs : [check-release, prepare-release, build-and-release]
633+ needs :
634+ [check-release, prepare-release, build-and-release, generate-updater-json]
574635 if : needs.check-release.outputs.should_release == 'true'
575636 uses : ./.github/workflows/reusable-create-release-branch.yml
576637 with :
577638 version : ${{ needs.prepare-release.outputs.tag }}
578639 max_branches : 5
579640 secrets : inherit
580641
581- # Step 7 : Notify about release completion
642+ # Step 8 : Notify about release completion
582643 notify-completion :
583644 name : " Release Complete"
584645 runs-on : ubuntu-latest
585646 needs :
586- [prepare-release, build-android, build-and-release, create-release-branch]
647+ [
648+ prepare-release,
649+ build-android,
650+ build-and-release,
651+ generate-updater-json,
652+ create-release-branch,
653+ ]
587654 if : always() && needs.prepare-release.result == 'success'
588655 steps :
589656 - name : Release summary
0 commit comments