Compare commits

..

12 Commits

Author SHA1 Message Date
GitHub Actions
47f1b2c40f chore: bump version to 4.11.83 [skip ci] 2026-04-07 12:48:26 +00:00
d04c1e8f77 fix: rename build job and streamline APK upload process
All checks were successful
Build / increment-version (push) Successful in 6s
Build / build-and-release (push) Successful in 4m45s
2026-04-07 22:48:17 +10:00
GitHub Actions
76a19f7e02 chore: bump version to 4.11.82 [skip ci] 2026-04-07 10:57:10 +00:00
3d35ea5930 Merge branch 'master' of http://synbox.ruv.wtf:8418/litruv/cinny-mobile
Some checks failed
Build / increment-version (push) Successful in 5s
Build / build-android (push) Failing after 4m37s
Build / create-release (push) Has been skipped
2026-04-07 20:57:03 +10:00
9fe79de3b5 fix: update upload artifact action to v4 and adjust APK naming convention 2026-04-07 20:57:02 +10:00
GitHub Actions
044631b05d chore: bump version to 4.11.81 [skip ci] 2026-04-07 10:45:54 +00:00
4bc5b4d790 Merge branch 'master' of http://synbox.ruv.wtf:8418/litruv/cinny-mobile
Some checks failed
Build / increment-version (push) Successful in 7s
Build / build-android (push) Successful in 5m11s
Build / create-release (push) Failing after 3m7s
2026-04-07 20:45:46 +10:00
da52ec84b7 fix: improve handling of joined rooms and event notifications in MatrixSyncService 2026-04-07 20:45:44 +10:00
GitHub Actions
f758796d83 chore: bump version to 4.11.80 [skip ci] 2026-04-07 10:42:53 +00:00
77d4071728 Merge branch 'master' of http://synbox.ruv.wtf:8418/litruv/cinny-mobile
Some checks failed
Build / increment-version (push) Successful in 6s
Build / create-release (push) Has been cancelled
Build / build-android (push) Has been cancelled
2026-04-07 20:42:44 +10:00
ca855a6945 feat: sync version from package.json into build.gradle and set APK output name 2026-04-07 20:42:43 +10:00
GitHub Actions
a56662ab69 chore: bump version to 4.11.79 [skip ci] 2026-04-07 10:36:35 +00:00
5 changed files with 45 additions and 55 deletions

View File

@@ -47,7 +47,7 @@ jobs:
git commit -m "chore: bump version to ${{ steps.bump.outputs.VERSION }} [skip ci]" git commit -m "chore: bump version to ${{ steps.bump.outputs.VERSION }} [skip ci]"
git push git push
build-android: build-and-release:
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: increment-version needs: increment-version
if: always() && (needs.increment-version.outputs.should_build == 'true' || needs.increment-version.result == 'skipped') if: always() && (needs.increment-version.outputs.should_build == 'true' || needs.increment-version.result == 'skipped')
@@ -56,6 +56,7 @@ jobs:
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v4 uses: actions/checkout@v4
with: with:
fetch-depth: 0
submodules: false submodules: false
ref: ${{ github.ref_name }} ref: ${{ github.ref_name }}
@@ -92,28 +93,6 @@ jobs:
- name: Apply overlay and build Android APK - name: Apply overlay and build Android APK
run: npm run android:apk:linux run: npm run android:apk:linux
- name: Upload APK
uses: actions/upload-artifact@v3
with:
name: Paarrot-Android-debug.apk
path: android/app/build/outputs/apk/debug/app-debug.apk
create-release:
runs-on: ubuntu-latest
needs: [increment-version, build-android]
if: always() && needs.build-android.result == 'success'
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.ref_name }}
- name: Pull latest (after version bump)
if: github.ref == 'refs/heads/master'
run: git pull origin master
- name: Get version - name: Get version
id: version id: version
run: | run: |
@@ -143,21 +122,6 @@ jobs:
git tag -a "v${{ steps.version.outputs.VERSION }}" -m "Release v${{ steps.version.outputs.VERSION }}" git tag -a "v${{ steps.version.outputs.VERSION }}" -m "Release v${{ steps.version.outputs.VERSION }}"
git push origin "v${{ steps.version.outputs.VERSION }}" git push origin "v${{ steps.version.outputs.VERSION }}"
- name: Download all artifacts
uses: actions/download-artifact@v3
with:
path: artifacts
- name: Prepare release files
run: |
mkdir -p release-files
find artifacts -type f \( -name "*.exe" -o -name "*.AppImage" -o -name "*.nupkg" -o -name "RELEASES*" \) -exec cp {} release-files/ \;
APK=$(find artifacts -type f -name "*.apk" | head -1)
if [ -n "$APK" ]; then
cp "$APK" "release-files/Paarrot.apk"
fi
ls -la release-files/
- name: Create or Update Release - name: Create or Update Release
env: env:
GITEA_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITEA_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -167,6 +131,13 @@ jobs:
API_BASE="http://synbox.ruv.wtf:8418/api/v1" API_BASE="http://synbox.ruv.wtf:8418/api/v1"
REPO="litruv/cinny-mobile" REPO="litruv/cinny-mobile"
APK=$(find android/app/build/outputs/apk/debug -name "Paarrot-*.apk" | head -1)
if [ -z "$APK" ]; then
echo "No APK found!"
exit 1
fi
echo "Found APK: $APK"
RELEASE_ID=$(curl -s -H "Authorization: token ${GITEA_TOKEN}" \ RELEASE_ID=$(curl -s -H "Authorization: token ${GITEA_TOKEN}" \
"${API_BASE}/repos/${REPO}/releases/tags/${TAG_NAME}" | jq -r '.id // empty') "${API_BASE}/repos/${REPO}/releases/tags/${TAG_NAME}" | jq -r '.id // empty')
@@ -188,16 +159,13 @@ jobs:
done done
fi fi
echo "Uploading assets..." FILENAME="Paarrot-${VERSION}.apk"
for FILE in release-files/*; do echo "Uploading ${FILENAME}..."
FILENAME=$(basename "$FILE") curl -s -X POST \
echo "Uploading ${FILENAME}..." -H "Authorization: token ${GITEA_TOKEN}" \
curl -s -X POST \ -H "Content-Type: application/octet-stream" \
-H "Authorization: token ${GITEA_TOKEN}" \ --data-binary "@${APK}" \
-H "Content-Type: application/octet-stream" \ "${API_BASE}/repos/${REPO}/releases/${RELEASE_ID}/assets?name=${FILENAME}"
--data-binary "@${FILE}" \ echo ""
"${API_BASE}/repos/${REPO}/releases/${RELEASE_ID}/assets?name=${FILENAME}"
echo ""
done
echo "Release complete!" echo "Release complete!"

View File

@@ -23,6 +23,11 @@ android {
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
} }
} }
applicationVariants.all { variant ->
variant.outputs.all { output ->
outputFileName = "Paarrot-${variant.versionName}.apk"
}
}
} }
repositories { repositories {

View File

@@ -143,10 +143,11 @@ class MatrixSyncService : Service() {
val nm = getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager val nm = getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager
ensureMessageChannel(nm) ensureMessageChannel(nm)
joinedRooms.keys().forEach { roomId -> val roomIds = joinedRooms.keys().asSequence().toList()
for (roomId in roomIds) {
val timeline = joinedRooms.optJSONObject(roomId) val timeline = joinedRooms.optJSONObject(roomId)
?.optJSONObject("timeline") ?: return@forEach ?.optJSONObject("timeline") ?: continue
val events = timeline.optJSONArray("events") ?: return@forEach val events = timeline.optJSONArray("events") ?: continue
for (i in 0 until events.length()) { for (i in 0 until events.length()) {
val event = events.optJSONObject(i) ?: continue val event = events.optJSONObject(i) ?: continue
@@ -157,7 +158,7 @@ class MatrixSyncService : Service() {
if (eventId.isNotBlank() && !shownEventIds.add(eventId)) continue if (eventId.isNotBlank() && !shownEventIds.add(eventId)) continue
val content = event.optJSONObject("content") ?: continue val content = event.optJSONObject("content") ?: continue
val body = content.optString("body").ifBlank { continue } val body = content.optString("body").takeIf { it.isNotBlank() } ?: continue
val sender = event.optString("sender") val sender = event.optString("sender")
val senderName = sender.substringAfter("@").substringBefore(":") val senderName = sender.substringAfter("@").substringBefore(":")

View File

@@ -1,6 +1,6 @@
{ {
"name": "paarrot", "name": "paarrot",
"version": "4.11.78", "version": "4.11.83",
"description": "Paarrot - A Matrix client based on Cinny", "description": "Paarrot - A Matrix client based on Cinny",
"engines": { "engines": {
"node": ">=18.0.0" "node": ">=18.0.0"

View File

@@ -120,7 +120,23 @@ if (!existsSync(androidJunction)) {
console.log(` android/ link already exists, skipping`); console.log(` android/ link already exists, skipping`);
} }
// 7. Write android/local.properties with the current machine's Android SDK path // 8. Sync version from root package.json into android/app/build.gradle
console.log('[apply-overlay] Syncing version into build.gradle...');
const rootPkg = JSON.parse(readFileSync(join(ROOT, 'package.json'), 'utf8'));
const version = rootPkg.version ?? '1.0.0';
const parts = version.split('.').map(Number);
// versionCode: major*10000 + minor*100 + patch (e.g. 4.11.78 -> 41178)
const versionCode = (parts[0] ?? 0) * 10000 + (parts[1] ?? 0) * 100 + (parts[2] ?? 0);
const buildGradlePath = join(androidTarget, 'app', 'build.gradle');
let buildGradle = readFileSync(buildGradlePath, 'utf8');
buildGradle = buildGradle
.replace(/versionCode\s+\d+/, `versionCode ${versionCode}`)
.replace(/versionName\s+"[^"]+"/, `versionName "${version}"`);
writeFileSync(buildGradlePath, buildGradle, 'utf8');
console.log(` versionName "${version}", versionCode ${versionCode}`);
// 9. Write android/local.properties with the current machine's Android SDK path
const androidHome = process.env.ANDROID_HOME || process.env.ANDROID_SDK_ROOT; const androidHome = process.env.ANDROID_HOME || process.env.ANDROID_SDK_ROOT;
if (androidHome) { if (androidHome) {
console.log('[apply-overlay] Writing android/local.properties...'); console.log('[apply-overlay] Writing android/local.properties...');