diff --git a/.forgejo/workflows/release.yml b/.forgejo/workflows/release.yml new file mode 100644 index 0000000..a320fda --- /dev/null +++ b/.forgejo/workflows/release.yml @@ -0,0 +1,57 @@ +name: Release APK + +on: + push: + tags: ["v*"] + +jobs: + build: + runs-on: linux-x86_64 + + steps: + - uses: actions/checkout@v4 + + - name: Extract version + run: | + VERSION=$(grep '^version:' pubspec.yaml | sed 's/version: //') + echo "VERSION_CODE=$(echo "$VERSION" | grep -oP '(?<=\+)\d+')" >> $GITHUB_ENV + echo "VERSION_NAME=$(echo "$VERSION" | grep -oP '^[^+]+')" >> $GITHUB_ENV + + - name: Decode keystore + run: | + echo "${{ secrets.KEYSTORE_BASE64 }}" | base64 -d > android/app/release.jks + echo "KEYSTORE_PATH=$GITHUB_WORKSPACE/android/app/release.jks" >> $GITHUB_ENV + + - name: Build release APK + env: + STORE_PASSWORD: ${{ secrets.STORE_PASSWORD }} + KEY_ALIAS: ${{ secrets.KEY_ALIAS }} + KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }} + run: | + env -u GITHUB_TOKEN -u GH_TOKEN -u JAVA_HOME \ + devbox run -- flutter build apk --release + + - name: Create release and upload APK + env: + FORGEJO_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + APK="plasmoid-${{ env.VERSION_NAME }}.apk" + cp build/app/outputs/flutter-apk/app-release.apk "$APK" + + BODY=$(python3 -c " + import json + print(json.dumps(open('fastlane/metadata/android/en-US/changelogs/${{ env.VERSION_CODE }}.txt').read().strip())) + ") + + RELEASE_ID=$(curl -sf -X POST \ + -H "Authorization: token $FORGEJO_TOKEN" \ + -H "Content-Type: application/json" \ + "$GITHUB_SERVER_URL/api/v1/repos/$GITHUB_REPOSITORY/releases" \ + -d "{\"tag_name\":\"$GITHUB_REF_NAME\",\"name\":\"$GITHUB_REF_NAME\",\"body\":$BODY}" \ + | python3 -c 'import sys,json; print(json.load(sys.stdin)["id"])') + + curl -sf -X POST \ + -H "Authorization: token $FORGEJO_TOKEN" \ + -H "Content-Type: application/vnd.android.package-archive" \ + "$GITHUB_SERVER_URL/api/v1/repos/$GITHUB_REPOSITORY/releases/$RELEASE_ID/assets?name=$APK" \ + --data-binary @"$APK" diff --git a/.gitignore b/.gitignore index f6bd313..c833c63 100644 --- a/.gitignore +++ b/.gitignore @@ -46,3 +46,7 @@ app.*.map.json # Devbox .devbox/ + +# Signing +*.jks +key.properties diff --git a/android/app/build.gradle b/android/app/build.gradle index 8fe74b2..f62acb7 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -32,11 +32,18 @@ android { targetSdkVersion 36 } + signingConfigs { + release { + storeFile = System.getenv("KEYSTORE_PATH") ? file(System.getenv("KEYSTORE_PATH")) : null + storePassword = System.getenv("STORE_PASSWORD") + keyAlias = System.getenv("KEY_ALIAS") + keyPassword = System.getenv("KEY_PASSWORD") + } + } + buildTypes { release { - // TODO: Add your own signing config for the release build. - // Signing with the debug keys for now, so `flutter run --release` works. - signingConfig = signingConfigs.debug + signingConfig = System.getenv("KEYSTORE_PATH") ? signingConfigs.release : signingConfigs.debug } } } diff --git a/fastlane/Fastfile b/fastlane/Fastfile new file mode 100644 index 0000000..87707fa --- /dev/null +++ b/fastlane/Fastfile @@ -0,0 +1 @@ +default_platform(:android) diff --git a/fastlane/metadata/android/en-US/changelogs/3.txt b/fastlane/metadata/android/en-US/changelogs/3.txt new file mode 100644 index 0000000..80e6b1b --- /dev/null +++ b/fastlane/metadata/android/en-US/changelogs/3.txt @@ -0,0 +1 @@ +Added D-pad navigation for TV/remote and hardware-keyboard devices. diff --git a/fastlane/metadata/android/en-US/full_description.txt b/fastlane/metadata/android/en-US/full_description.txt new file mode 100644 index 0000000..97870af --- /dev/null +++ b/fastlane/metadata/android/en-US/full_description.txt @@ -0,0 +1,9 @@ +Plasmoid is a minimalist and opinionated app launcher for Android. + +Features: + +* Search & Launch — Start typing to filter apps by name or tag. Tap to launch immediately. +* Tagging — Long-press an app and choose Edit Tags to assign tags. Tags are searchable using prefixes: @context, #general, +project. +* Gestures — Swipe right to pin an app to the top (swipe right again to unpin). Swipe left to demote an app to the bottom (swipe left again to restore). Long-press for Edit Tags, App Info, and more. +* D-Pad — From the search field, press down to close the keyboard and move into the list, or right to clear the search (or open the menu when it's empty). In the list, up and down move the selection, center launches, left returns to the search field, and right opens the menu. Hold left to promote an app (pin or restore it), hold right to demote it (unpin or move it to the bottom), and hold center to open or close the app menu. +* Settings — Toggle icon visibility, color mode, theme, sort order, auto-focus, status icons, and demoted app visibility from the menu. diff --git a/fastlane/metadata/android/en-US/short_description.txt b/fastlane/metadata/android/en-US/short_description.txt new file mode 100644 index 0000000..99f7762 --- /dev/null +++ b/fastlane/metadata/android/en-US/short_description.txt @@ -0,0 +1 @@ +A minimalist and opinionated app launcher with tagging and D-pad support. diff --git a/fastlane/metadata/android/en-US/title.txt b/fastlane/metadata/android/en-US/title.txt new file mode 100644 index 0000000..3e68112 --- /dev/null +++ b/fastlane/metadata/android/en-US/title.txt @@ -0,0 +1 @@ +Plasmoid