diff --git a/.forgejo/workflows/release.yml b/.forgejo/workflows/release.yml new file mode 100644 index 0000000..2e2b66a --- /dev/null +++ b/.forgejo/workflows/release.yml @@ -0,0 +1,57 @@ +name: Release APK + +on: + push: + tags: ["v*"] + +jobs: + build: + runs-on: android + + 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="muzzlevelocity-${{ 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 cab8055..b96512b 100644 --- a/.gitignore +++ b/.gitignore @@ -47,3 +47,7 @@ app.*.map.json # devbox .devbox/ nix-android-sdk/flake.lock + +# Release signing (see RELEASE.md) +**/*.jks +key.properties diff --git a/android/app/build.gradle b/android/app/build.gradle index 917552e..7109d3c 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -33,11 +33,19 @@ android { targetSdkVersion 34 } + 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 + // Falls back to the debug keys locally, so `flutter run --release` keeps working. + 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/2.txt b/fastlane/metadata/android/en-US/changelogs/2.txt new file mode 100644 index 0000000..24b5313 --- /dev/null +++ b/fastlane/metadata/android/en-US/changelogs/2.txt @@ -0,0 +1 @@ +Built-in Markdown editor, keyboard shortcuts, and D-pad navigation for phones. 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..f28888f --- /dev/null +++ b/fastlane/metadata/android/en-US/full_description.txt @@ -0,0 +1,8 @@ +A fast and minimalist note-taking app inspired by Notational Velocity and Terminal Velocity. Notes are plain Markdown files in a folder you choose, so you can sync or edit them with other tools. + +- One search bar to filter notes by title, content, and #tags, +projects, or @contexts, and to create a note by pressing Enter. +- Notes open read-only with Markdown highlighting, and jump to the search match. Switch to editing with one tap. +- Editing helps with Markdown: wrapping selections, continuing lists, and keeping indentation. +- Keyboard shortcuts on desktop and D-pad navigation on phones. + +The in-app Help page describes every feature. diff --git a/fastlane/metadata/android/en-US/images/icon.png b/fastlane/metadata/android/en-US/images/icon.png new file mode 100644 index 0000000..88cfd48 Binary files /dev/null and b/fastlane/metadata/android/en-US/images/icon.png differ 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..b7593af --- /dev/null +++ b/fastlane/metadata/android/en-US/short_description.txt @@ -0,0 +1 @@ +A fast, minimalist note-taking app inspired by Notational Velocity. diff --git a/fastlane/metadata/android/en-US/title.txt b/fastlane/metadata/android/en-US/title.txt new file mode 100644 index 0000000..455fed5 --- /dev/null +++ b/fastlane/metadata/android/en-US/title.txt @@ -0,0 +1 @@ +Muzzle Velocity