Commit Graph

4 Commits

Author SHA1 Message Date
Nik Clayton dda9dde1b9
feat: Periodically check for updates and alert user (#236)
Users can inadvertently get stuck on older versions of the app; e.g., by
installing from one F-Droid repository that stops hosting the app at
some later time.

Analytics from the Play Store also shows a long tail of users who are,
for some reason, on an older version.

On resuming `MainActivity`, and approximately once per day, check and
see if a newer version of Pachli is available, and prompt the user to
update by going to the relevant install location (Google Play, F-Droid,
or GitHub).

The dialog prompt allows them to ignore this specific version, or
disable all future update notifications. This is also exposed through
the preferences, so the user can adjust it there too.

A different update check method is used for each installation location.

- F-Droid: Use the F-Droid API to query for the newest released version
- GitHub: Use the GitHub API to query for the newest release, and check
the APK filename attached to that release
- Google Play: Use the Play in-app-updates library
(https://developer.android.com/guide/playcore/in-app-updates) to query
for the newest released version

These are kept in different build flavours (source sets), so that e.g.,
the build for the F-Droid store can only query the F-Droid API, the UI
strings are specific to F-Droid, etc. This also ensures that the update
service libraries are specific to that build and do not
"cross-contaminate".

Note that this *does not* update the app, it takes the user to either
the relevant store page (F-Droid, Play) or GitHub release page. The user
must still start the update from that page.

CI configuration is updated to build the different flavours.
2023-11-08 08:42:39 +01:00
Nik Clayton 8fd536b77f
ci: Fetch all revisions to calculate correct versionCode (#147)
Previous configuration only fetched the most recent revision. Since the
`orangeRelease` `versionCode` is calculated from the number of previous
revisions this always set the `versionCode` to 1.

Fetch all revisions to avoid this.
2023-10-09 17:49:15 +02:00
Nik Clayton 1161875014
ci: Upload Pachli Current to the production track (#142) 2023-10-07 14:59:20 +02:00
Nik Clayton d434144922
ci: Upload orangeRelease to Google Play (internal track) (#134)
Start building infrastructure to automatically build and deploy the
`orangeRelease` variant to Google Play.

The variant needs an automatically incrementing `versionCode`. That is
derived from the count of all commits.

Change the separator between the version and the build metadata in the
`versionName` from `-` to `+` to be consistent with semantic versioning.

This is still an experiment, so the workflow is triggered manually and
only uploads to the internal track
2023-09-28 13:50:02 +02:00