Misc improvements + CI/CD fix #2
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: Nullgram Deployment | |
| on: | |
| push: | |
| branches: | |
| - master | |
| permissions: | |
| actions: write | |
| jobs: | |
| build-and-deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Java | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: "21" | |
| distribution: "corretto" | |
| - name: Decode keystore | |
| run: | | |
| echo "$ANDROID_KEYSTORE_BASE64" | base64 --decode > keystore.jks | |
| env: | |
| ANDROID_KEYSTORE_BASE64: ${{ secrets.ANDROID_KEYSTORE_BASE64 }} | |
| - name: Cache pub dependencies | |
| uses: actions/cache@v3 | |
| with: | |
| path: ~/.pub-cache | |
| key: ${{ runner.os }}-pub-${{ hashFiles('**/pubspec.yaml') }} | |
| restore-keys: ${{ runner.os }}-pub | |
| - name: Set up Flutter | |
| uses: subosito/flutter-action@v2 | |
| with: | |
| channel: 'stable' | |
| flutter-version-file: pubspec.yaml | |
| - name: Install dependencies | |
| run: flutter pub get | |
| - name: Build signed APK | |
| run: flutter build apk --release --split-per-abi | |
| env: | |
| ANDROID_KEYSTORE: ${{ github.workspace }}/keystore.jks | |
| KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }} | |
| KEYSTORE_ALIAS: ${{ secrets.KEYSTORE_ALIAS }} | |
| KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }} | |
| - name: Archive APKs | |
| run: | | |
| mkdir -p release-apks | |
| cp build/app/outputs/flutter-apk/*.apk release-apks/ | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: v${{ github.run_number }} | |
| name: "Release v${{ github.run_number }}" | |
| body: | | |
| 📦 New Nullgram APK release | |
| 📝 Commit: ${{ github.event.head_commit.message }} | |
| 🕒 Date: ${{ github.event.head_commit.timestamp }} | |
| files: release-apks/*.apk | |
| env: | |
| GITHUB_TOKEN: ${{ github.token }} |