From 6c92ba9b8ad03e91ae9bea2ea17d06a5addc8b75 Mon Sep 17 00:00:00 2001 From: Dane Madsen Date: Sat, 20 Apr 2024 18:53:17 +1000 Subject: [PATCH] Linux AppImage Build (#501) * try setup flutter from submodule * try use flutter path * small change * revert * small change to fastlane.yml * Android appimage * small android fix * small change to artifact * libfuse * small fixes * icon * explicitly copy * app-bundle * small fix * image icon * Create AppRun --- .github/workflows/build-android.yml | 2 +- .github/workflows/build-linux.yml | 53 +++++++++++++++++++++++- .github/workflows/fastlane.yml | 8 ++++ .github/workflows/release.yml | 63 +++++++++++++++++++++++++++++ 4 files changed, 124 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/build-android.yml b/.github/workflows/build-android.yml index 05224e0c..a4aeb768 100644 --- a/.github/workflows/build-android.yml +++ b/.github/workflows/build-android.yml @@ -2,7 +2,7 @@ name: Build Android on: release: - types: [published] + types: [published] push: branches: - main diff --git a/.github/workflows/build-linux.yml b/.github/workflows/build-linux.yml index 2d281ebf..c234b7ee 100644 --- a/.github/workflows/build-linux.yml +++ b/.github/workflows/build-linux.yml @@ -36,4 +36,55 @@ jobs: uses: actions/upload-artifact@v4 with: name: maid-linux - path: build/linux/x64/release/bundle \ No newline at end of file + path: build/linux/x64/release/bundle + + create-appimage: + needs: build + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Download Linux Build + uses: actions/download-artifact@v4 + with: + name: maid-linux + path: maid-linux + + - name: Install AppImage tools and dependencies + run: | + sudo apt-get update + sudo apt-get install -y appstream util-linux libfuse2 + + - name: Download and Install AppImageTool + run: | + wget https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage + chmod +x appimagetool-x86_64.AppImage + sudo mv appimagetool-x86_64.AppImage /usr/local/bin/appimagetool + + - name: Prepare AppDir + run: | + mkdir AppDir + cp -r maid-linux/* AppDir/ + cp assets/maid.png AppDir/icon.png + echo '[Desktop Entry] + Name=Maid + Exec=maid + Icon=icon + Type=Application + Categories=Utility;' > AppDir/maid.desktop + chmod +x AppDir/maid + echo '#!/bin/bash + HERE="$(dirname "$(readlink -f "${0}")")" + exec "$HERE/maid" "$@"' > AppDir/AppRun + chmod +x AppDir/AppRun + + - name: Create AppImage + run: | + appimagetool AppDir maid.AppImage + + - name: Upload AppImage + uses: actions/upload-artifact@v4 + with: + name: maid-appimage + path: ./maid.AppImage \ No newline at end of file diff --git a/.github/workflows/fastlane.yml b/.github/workflows/fastlane.yml index 44acbc4a..4f85c859 100644 --- a/.github/workflows/fastlane.yml +++ b/.github/workflows/fastlane.yml @@ -1,10 +1,18 @@ name: Validate Fastlane on: + push: + branches: + - main + - dev + paths: + - 'fastlane/**' pull_request: branches: - main - dev + paths: + - 'fastlane/**' jobs: validate_metadata: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..fe041a1a --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,63 @@ +name: New Release + +on: + workflow_dispatch: + +jobs: + build_android: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + submodules: recursive + + - name: Set up JDK 17 + uses: actions/setup-java@v2 + with: + java-version: '17' + distribution: 'adopt' + + - name: Setup Flutter + uses: subosito/flutter-action@v2 + with: + flutter-version: '3.19.5' + + - name: Decode Keystore File + env: + KEYSTORE: ${{ secrets.KEYSTORE }} + run: echo "$KEYSTORE" | base64 --decode > android/app/key.jks + + - name: Create key.properties + run: | + echo "storeFile=key.jks" > android/key.properties + echo "storePassword=${{ secrets.STORE_PASSWORD }}" >> android/key.properties + echo "keyPassword=${{ secrets.KEY_PASSWORD }}" >> android/key.properties + echo "releasePassword=${{ secrets.KEY_PASSWORD }}" >> android/key.properties + echo "keyAlias=${{ secrets.KEY_ALIAS }}" >> android/key.properties + echo "releaseAlias=${{ secrets.KEY_ALIAS }}" >> android/key.properties + + - name: Setup Flutter + run: | + flutter config --no-analytics + flutter pub get + + - name: Build APK + run: | + flutter build apk --split-per-abi + + - name: Upload APK + uses: actions/upload-artifact@v4 + with: + name: maid-android-apk + path: build/app/outputs/apk/release + + - name: Build appbundle + run: | + flutter build appbundle + + - name: Upload AAB + uses: actions/upload-artifact@v4 + with: + name: maid-android-aab + path: build/app/outputs/bundle/release/app-release.aab \ No newline at end of file