git.iko.soy/parseable-android
on master help sign in
Switch to date-based versioning for releases (#19)
54bb88eiko
.github/workflows/ci.yml+19−26
@@ -6,14 +6,13 @@ on:
6 push:
6 push:
7 branches: [ master, main ]
7 branches: [ master, main ]
8
8
9−concurrency:
10− group: ci-${{ github.ref }}
11− cancel-in-progress: true
12−
13jobs:
9jobs:
14 build:
10 build:
15 name: Build & Lint
11 name: Build & Lint
16 runs-on: ubuntu-latest
12 runs-on: ubuntu-latest
13+ concurrency:
14+ group: ci-build-${{ github.ref }}
15+ cancel-in-progress: true
17
16
18 steps:
17 steps:
19 - name: Checkout code
18 - name: Checkout code
@@ -59,11 +58,14 @@ jobs:
59 path: app/build/reports/lint-results-release.html
58 path: app/build/reports/lint-results-release.html
60 retention-days: 14
59 retention-days: 14
61
60
62− prerelease:
61+ release:
63− name: Create Prerelease
62+ name: Create Release
64 needs: build
63 needs: build
65 if: github.event_name == 'push'
64 if: github.event_name == 'push'
66 runs-on: ubuntu-latest
65 runs-on: ubuntu-latest
66+ concurrency:
67+ group: release
68+ cancel-in-progress: false
67 permissions:
69 permissions:
68 contents: write
70 contents: write
69
71
@@ -71,6 +73,11 @@ jobs:
71 - name: Checkout code
73 - name: Checkout code
72 uses: actions/checkout@v4
74 uses: actions/checkout@v4
73
75
76+ - name: Set version from commit timestamp
77+ run: |
78+ VERSION_NAME=$(TZ=UTC git log -1 --format='%cd' --date=format-local:'%Y.%m.%d.%H%M')
79+ echo "VERSION_NAME=$VERSION_NAME" >> $GITHUB_ENV
80+
74 - name: Set up JDK 17
81 - name: Set up JDK 17
75 uses: actions/setup-java@v4
82 uses: actions/setup-java@v4
76 with:
83 with:
@@ -89,31 +96,17 @@ jobs:
89 - name: Build release APK
96 - name: Build release APK
90 run: ./gradlew assembleRelease
97 run: ./gradlew assembleRelease
91
98
92− - name: Rename APK with commit SHA
99+ - name: Rename APK with version
93 run: |
100 run: |
94− SHORT_SHA=$(echo "${{ github.sha }}" | cut -c1-7)
95 for apk in app/build/outputs/apk/release/*.apk; do
101 for apk in app/build/outputs/apk/release/*.apk; do
96− mv "$apk" "app/build/outputs/apk/release/parseable-android-${SHORT_SHA}.apk"
102+ mv "$apk" "app/build/outputs/apk/release/parseable-android-${VERSION_NAME}.apk"
97 done
103 done
98
104
99− - name: Delete existing latest-master tag and release
105+ - name: Create release
100− env:
101− GH_TOKEN: ${{ github.token }}
102− run: |
103− gh release delete latest-master --yes || true
104− git push origin :refs/tags/latest-master || true
105−
106− - name: Create prerelease
107 uses: softprops/action-gh-release@v2
106 uses: softprops/action-gh-release@v2
108 with:
107 with:
109− tag_name: latest-master
108+ tag_name: v${{ env.VERSION_NAME }}
110− name: "Latest Master Build (${{ github.sha }})"
109+ name: v${{ env.VERSION_NAME }}
111− prerelease: true
110+ generate_release_notes: true
112− body: |
113− Automated prerelease from commit ${{ github.sha }}.
114−
115− **Commit:** [`${{ github.sha }}`](${{ github.server_url }}/${{ github.repository }}/commit/${{ github.sha }})
116− **Branch:** `${{ github.ref_name }}`
117− **Triggered by:** @${{ github.actor }}
118 files: |
111 files: |
119 app/build/outputs/apk/release/*.apk
112 app/build/outputs/apk/release/*.apk
README.md+11
@@ -43,6 +43,17 @@ An Android client for [Parseable](https://www.parseable.com/), the open-source l
43| `/api/v1/alerts` | GET | List alerts |
43| `/api/v1/alerts` | GET | List alerts |
44| `/api/v1/user` | GET | List users |
44| `/api/v1/user` | GET | List users |
45
45
46+## Installation
47+
48+The recommended way to install Parseable Android is via [Obtainium](https://github.com/ImranR98/Obtainium), which will automatically notify you of new releases.
49+
50+1. Install [Obtainium](https://github.com/ImranR98/Obtainium) on your device.
51+2. Open Obtainium and tap **Add App**.
52+3. Enter this repository URL: `https://github.com/ilyakooo0/parseable-android`
53+4. Tap **Add** — Obtainium will fetch the latest release APK and install it.
54+
55+Updates will be detected automatically whenever a new release is published.
56+
46## Building
57## Building
47
58
48```bash
59```bash
app/build.gradle.kts+13−2
@@ -1,3 +1,7 @@
1+import java.time.Instant
2+import java.time.ZoneOffset
3+import java.time.format.DateTimeFormatter
4+
1plugins {
5plugins {
2 alias(libs.plugins.android.application)
6 alias(libs.plugins.android.application)
3 alias(libs.plugins.kotlin.android)
7 alias(libs.plugins.kotlin.android)
@@ -7,6 +11,13 @@ plugins {
7 alias(libs.plugins.ksp)
11 alias(libs.plugins.ksp)
8}
12}
9
13
14+val commitEpoch = providers.exec {
15+ commandLine("git", "log", "-1", "--format=%ct")
16+}.standardOutput.asText.get().trim().toLong()
17+val commitTime = Instant.ofEpochSecond(commitEpoch).atZone(ZoneOffset.UTC)
18+val dateVersionName = commitTime.format(DateTimeFormatter.ofPattern("yyyy.MM.dd.HHmm"))
19+val dateVersionCode = (commitEpoch / 60).toInt()
20+
10android {
21android {
11 namespace = "com.parseable.android"
22 namespace = "com.parseable.android"
12 compileSdk = 35
23 compileSdk = 35
@@ -15,8 +26,8 @@ android {
15 applicationId = "com.parseable.android"
26 applicationId = "com.parseable.android"
16 minSdk = 26
27 minSdk = 26
17 targetSdk = 35
28 targetSdk = 35
18− versionCode = libs.versions.appVersionCode.get().toInt()
29+ versionCode = dateVersionCode
19− versionName = libs.versions.appVersionName.get()
30+ versionName = dateVersionName
20
31
21 testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
32 testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
22 }
33 }
gradle/libs.versions.toml−4
@@ -1,8 +1,4 @@
1[versions]
1[versions]
2−# App versioning
3−appVersionCode = "1"
4−appVersionName = "1.0.0"
5−
6agp = "8.7.3"
2agp = "8.7.3"
7kotlin = "2.1.0"
3kotlin = "2.1.0"
8ksp = "2.1.0-1.0.29"
4ksp = "2.1.0-1.0.29"