updated readme #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 SmoothSSH Release | |
| on: | |
| push: | |
| branches: [ "main" ] | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| jobs: | |
| # ============================================================================ | |
| # JOB 1: Android APKs | |
| # ============================================================================ | |
| build-android: | |
| name: Build Android APKs | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Extract Zippy Zebra Version | |
| id: get_version | |
| run: | | |
| # Finds the line in settings_screen.dart and extracts the string | |
| LINE=$(grep "applicationVersion:" lib/screens/settings_screen.dart) | |
| FULL_STRING=$(echo "$LINE" | sed "s/.*'\(.*\)'.*/\1/") | |
| VERSION_ONLY=$(echo "$FULL_STRING" | cut -d' ' -f1) | |
| RELEASE_NAME=$(echo "$FULL_STRING" | cut -d'-' -f2- | xargs) | |
| echo "VERSION=$VERSION_ONLY" >> $GITHUB_ENV | |
| echo "REL_NAME=$RELEASE_NAME" >> $GITHUB_ENV | |
| - name: Setup Java | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: 'zulu' | |
| java-version: '17' | |
| - name: Setup Flutter | |
| uses: subosito/flutter-action@v2 | |
| with: | |
| channel: 'stable' | |
| - name: Install dependencies | |
| run: flutter pub get | |
| - name: Build Android Bundle and Split APKs | |
| run: | | |
| flutter build appbundle --release | |
| flutter build apk --split-per-abi | |
| - name: Upload Android Artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: android-builds | |
| path: | | |
| build/app/outputs/flutter-apk/app-*-release.apk | |
| build/app/outputs/bundle/release/app-release.aab | |
| # ============================================================================ | |
| # JOB 2: Create GitHub Release | |
| # ============================================================================ | |
| create-release: | |
| name: Create Release | |
| needs: [build-android] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Extract Zippy Zebra Version (for Release metadata) | |
| run: | | |
| LINE=$(grep "applicationVersion:" lib/screens/settings_screen.dart) | |
| FULL_STRING=$(echo "$LINE" | sed "s/.*'\(.*\)'.*/\1/") | |
| VERSION_ONLY=$(echo "$FULL_STRING" | cut -d' ' -f1) | |
| RELEASE_NAME=$(echo "$FULL_STRING" | cut -d'-' -f2- | xargs) | |
| echo "VERSION=$VERSION_ONLY" >> $GITHUB_ENV | |
| echo "REL_NAME=$RELEASE_NAME" >> $GITHUB_ENV | |
| - name: Download all artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: android-builds | |
| path: artifacts | |
| - name: Create Release and Upload Assets | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: "v${{ env.VERSION }}-${{ github.run_number }}" | |
| name: "SmoothSSH: ${{ env.REL_NAME }}" | |
| body: | | |
| ### 🦓 Release: ${{ env.REL_NAME }} | |
| **Version:** ${{ env.VERSION }} | |
| **Build Number:** ${{ github.run_number }} | |
| Automated build for SmoothSSH. Includes split APKs for various Android architectures and the full App Bundle. | |
| files: | | |
| artifacts/**/*.apk | |
| artifacts/**/*.aab | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |