Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions .github/workflows/build-android-apk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,33 @@ jobs:
ANDROID_KEYSTORE_ALIAS: ${{ secrets.ANDROID_KEYSTORE_ALIAS }}
ANDROID_KEYSTORE_PASSWORD: ${{ secrets.ANDROID_KEYSTORE_PASSWORD }}

- name: Rename APK with version
run: |
if [[ "${{ github.ref }}" == refs/tags/v* ]]; then
VERSION="${{ github.ref_name }}"
else
VERSION_NUM=$(grep -oPm1 "(?<=<ApplicationDisplayVersion>)[^<]+" src/NoteBookmark.MauiApp/NoteBookmark.MauiApp.csproj || true)
if [ -z "$VERSION_NUM" ]; then
VERSION_NUM=$(grep -oPm1 "(?<=<Version>)[^<]+" Directory.Build.props)
fi
VERSION="v${VERSION_NUM#v}"
fi
echo "Using version: $VERSION"

PUBLISH_DIR="src/NoteBookmark.MauiApp/bin/Release/net10.0-android/publish"
for apk in "$PUBLISH_DIR"/*.apk; do
if [ -f "$apk" ]; then
filename=$(basename "$apk")
if [[ "$filename" == *"-Signed.apk" ]]; then
new_filename="${filename%-Signed.apk}-${VERSION}-Signed.apk"
else
new_filename="${filename%.apk}-${VERSION}.apk"
fi
echo "Renaming $apk to $PUBLISH_DIR/$new_filename"
mv "$apk" "$PUBLISH_DIR/$new_filename"
fi
done

- name: Upload APK artifact
uses: actions/upload-artifact@v4
with:
Expand Down
2 changes: 1 addition & 1 deletion docs/maui-android-install.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ This guide walks you through installing (often called "sideloading") the NoteBoo
2. Tap on the **Actions** tab at the top.
3. Select the latest successful **Build Android APK** run.
4. Scroll down to the **Artifacts** section and download the **`notebookmark-android-apk`** ZIP file.
5. Extract the ZIP file to retrieve the **`.apk`** installer file (e.g., `NoteBookmark.MauiApp.apk`).
5. Extract the ZIP file to retrieve the **`.apk`** installer file (e.g., `c5m.notebookmark.mauiapp-v1.4.2-Signed.apk`).

---

Expand Down
Loading