This repository was archived by the owner on Jun 20, 2026. It is now read-only.
Run release workflow on main #328
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: Flutter Build Release | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - dev | |
| workflow_dispatch: | |
| permissions: | |
| actions: write | |
| contents: write | |
| env: | |
| FLUTTER_VERSION: '3.41.9' | |
| jobs: | |
| cancel: | |
| name: Cancel Previous Runs | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: styfle/cancel-workflow-action@0.9.1 | |
| with: | |
| access_token: ${{ github.token }} | |
| android: | |
| needs: cancel | |
| name: Build APK | |
| runs-on: ubuntu-latest | |
| env: | |
| FLUTTER_KEY_ALIAS: ${{ secrets.FLUTTER_KEY_ALIAS }} | |
| FLUTTER_KEY_PASSWORD: ${{ secrets.FLUTTER_KEY_PASSWORD }} | |
| FLUTTER_STORE_PASSWORD: ${{ secrets.FLUTTER_STORE_PASSWORD }} | |
| steps: | |
| - name: Checkout Repository | |
| uses: actions/checkout@v3 | |
| with: | |
| submodules: recursive | |
| fetch-depth: 0 | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: 'temurin' # or 'zulu', depending on your preference | |
| java-version: '17' | |
| - name: Set up Gradle | |
| uses: gradle/actions/setup-gradle@v4 | |
| with: | |
| gradle-version: '8.10.2' | |
| - name: Cache Flutter SDK and dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.pub-cache | |
| ~/.flutter | |
| key: ${{ runner.os }}-flutter-${{ env.FLUTTER_VERSION }}-${{ hashFiles('**/pubspec.yaml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-flutter-${{ env.FLUTTER_VERSION }}- | |
| - name: Setup Flutter | |
| uses: subosito/flutter-action@v2 | |
| with: | |
| flutter-version: ${{ env.FLUTTER_VERSION }} | |
| - name: Decode Keystore | |
| run: echo "${{ secrets.FLUTTER_STORE_FILE }}" | base64 -d > android/app/release-key.jks | |
| - name: Install Dependencies | |
| run: flutter pub get | |
| - name: Build APK | |
| run: | | |
| flutter build apk --release | |
| - name: Rename APK | |
| run: mv build/app/outputs/flutter-apk/app-release.apk build/app/outputs/flutter-apk/InnerBreeze.apk | |
| - name: Upload APKs as Artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: apk-artifacts | |
| path: | | |
| build/app/outputs/flutter-apk/InnerBreeze.apk | |
| linux: | |
| needs: cancel | |
| name: Build Linux | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Repository | |
| uses: actions/checkout@v3 | |
| with: | |
| fetch-depth: 0 | |
| - name: Cache Flutter SDK | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.pub-cache | |
| ~/.flutter | |
| key: ${{ runner.os }}-flutter-${{ env.FLUTTER_VERSION }}-${{ hashFiles('**/pubspec.yaml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-flutter-${{ env.FLUTTER_VERSION }}- | |
| - name: Install Dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y \ | |
| clang \ | |
| cmake \ | |
| ninja-build \ | |
| pkg-config \ | |
| libgtk-3-dev \ | |
| libsysprof-capture-4-dev \ | |
| libpcre2-dev \ | |
| libmount-dev \ | |
| libunwind-dev \ | |
| libdw-dev \ | |
| libzstd-dev \ | |
| liborc-dev \ | |
| liblzma-dev \ | |
| gstreamer1.0-plugins-base \ | |
| gstreamer1.0-libav \ | |
| gstreamer1.0-plugins-good \ | |
| gstreamer1.0-plugins-bad \ | |
| gstreamer1.0-plugins-ugly \ | |
| libgstreamer1.0-dev \ | |
| libgstreamer-plugins-base1.0-dev \ | |
| libpangocairo-1.0-0 \ | |
| libpango-1.0-0 \ | |
| libharfbuzz0b \ | |
| libatk1.0-0 \ | |
| libcairo-gobject2 \ | |
| libcairo2 | |
| - name: Setup Flutter | |
| uses: subosito/flutter-action@v2 | |
| with: | |
| flutter-version: ${{ env.FLUTTER_VERSION }} | |
| - name: Install Dependencies | |
| run: flutter pub get | |
| - name: Build Linux Executable | |
| run: | | |
| flutter build linux --release | |
| - name: Create AppImage | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y libfuse2 | |
| # Download appimagetool from GitHub | |
| wget "https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage" | |
| chmod a+x appimagetool-x86_64.AppImage | |
| # Make Appdir | |
| cp -r build/linux/x64/release/bundle InnerBreeze.AppDir | |
| # Add the AppRun script | |
| echo -e '#!/bin/bash\ncurrent_dir="$(dirname "$(readlink -f "$0")")"\n"$current_dir/inner_breeze"' > InnerBreeze.AppDir/AppRun | |
| chmod +x InnerBreeze.AppDir/AppRun | |
| # Copy the existing desktop file | |
| cp snap/gui/io.naox.InnerBreeze.desktop InnerBreeze.AppDir/InnerBreeze.desktop | |
| cp snap/gui/io.naox.InnerBreeze.png InnerBreeze.AppDir/io.naox.InnerBreeze.png | |
| # Debug output | |
| echo "Contents of InnerBreeze.AppDir:" | |
| ls -R InnerBreeze.AppDir | |
| ./appimagetool-x86_64.AppImage InnerBreeze.AppDir | |
| mv Inner_Breeze-x86_64.AppImage InnerBreeze-x86_64.AppImage | |
| # Debug output | |
| echo "Contents of current directory:" | |
| ls -l | |
| # Verify AppImage creation | |
| if [ -f InnerBreeze-x86_64.AppImage ]; then | |
| echo "AppImage created successfully" | |
| else | |
| echo "AppImage creation failed" | |
| exit 1 | |
| fi | |
| - name: Archive Linux executable | |
| run: | | |
| mkdir -p organized_output/InnerBreeze-x86_64/ | |
| mv build/linux/x64/release/bundle/* organized_output/InnerBreeze-x86_64/ | |
| cp -r metadata organized_output/InnerBreeze-x86_64/ | |
| cp -r snap organized_output/InnerBreeze-x86_64/ | |
| cd organized_output | |
| tar -czf ../InnerBreeze-Linux-x86_64.tar.gz InnerBreeze-x86_64/ | |
| - name: Upload Linux Artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: linux-artifacts | |
| path: | | |
| InnerBreeze-Linux-x86_64.tar.gz | |
| InnerBreeze-x86_64.AppImage | |
| release: | |
| name: Release Builds | |
| needs: [android, linux] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Repository | |
| uses: actions/checkout@v3 | |
| with: | |
| fetch-depth: 0 | |
| - name: Read App Version | |
| id: app_version | |
| run: | | |
| FULL_VERSION=$(awk '/^version:/ { print $2; exit }' pubspec.yaml) | |
| VERSION=${FULL_VERSION%%+*} | |
| if [ -z "$VERSION" ]; then | |
| echo "Could not read version from pubspec.yaml" | |
| exit 1 | |
| fi | |
| echo "version=$VERSION" >> "$GITHUB_OUTPUT" | |
| echo "tag=$VERSION" >> "$GITHUB_OUTPUT" | |
| - name: Download APK Artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: apk-artifacts | |
| path: build/app/outputs/flutter-apk/ | |
| - name: Download Linux Artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: linux-artifacts | |
| path: build/linux/ | |
| - name: Create and Push Tag | |
| id: tag_version | |
| run: | | |
| TAG="${{ steps.app_version.outputs.tag }}" | |
| if git rev-parse "$TAG" >/dev/null 2>&1; then | |
| echo "Tag $TAG exists, using existing tag" | |
| else | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| git tag -a "$TAG" -m "Release $TAG" | |
| git push origin "$TAG" | |
| fi | |
| echo "tag_name=$TAG" >> "$GITHUB_OUTPUT" | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: ${{ steps.tag_version.outputs.tag_name }} | |
| name: ${{ steps.app_version.outputs.version }} | |
| generate_release_notes: true | |
| draft: false | |
| prerelease: false | |
| files: | | |
| build/app/outputs/flutter-apk/InnerBreeze.apk | |
| build/linux/InnerBreeze-Linux-x86_64.tar.gz | |
| build/linux/InnerBreeze-x86_64.AppImage | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |