Skip to content

Commit

Permalink
chore: try build for f-droid
Browse files Browse the repository at this point in the history
  • Loading branch information
linonetwo committed Sep 12, 2023
1 parent 3e45171 commit 8069d99
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 7 deletions.
11 changes: 7 additions & 4 deletions .github/workflows/build-apk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,26 +42,29 @@ jobs:
with:
distribution: 'zulu' # See 'Supported distributions' for available options
java-version: '11'
- name: Setup Gradle
- name: Setup Gradle # fix `incompatible version of Kotlin. The binary version of its metadata is 1.9.0, expected version is 1.7.1.`
uses: gradle/gradle-build-action@v2
with:
gradle-version: 8.0.1
gradle-version: 8.0.1 # use the gradle version I saw on eas build's console, which might match the kotlin version?

- name: Install dependencies
run: pnpm install

- name: remove prorietary bits (for f-droid)
run: npx zx scripts/fit-f-droid.mjs

## configure cash for gradle : will help to reduce build time
- name: Cache Gradle Wrapper
uses: actions/cache@v2
with:
path: ~/.gradle/wrapper
key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }}
key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('android/gradle/wrapper/gradle-wrapper.properties') }}

- name: Cache Gradle Dependencies
uses: actions/cache@v2
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-caches-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }}
key: ${{ runner.os }}-gradle-caches-${{ hashFiles('android/gradle/wrapper/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-caches-
Expand Down
6 changes: 6 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[submodule "libs/expo-location"]
path = libs/expo-location
url = https://github.com/Nonononoki/expo-location
[submodule "libs/expo-application"]
path = libs/expo-application
url = https://github.com/Nonononoki/expo-application
1 change: 1 addition & 0 deletions libs/expo-application
Submodule expo-application added at 9388d3
1 change: 1 addition & 0 deletions libs/expo-location
Submodule expo-location added at 18ddc3
4 changes: 4 additions & 0 deletions scripts/fit-f-droid.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import fs from 'fs-extra';

await Promise.all([fs.unlink('node_modules/expo-location'), fs.unlink('node_modules/expo-application')]);
await Promise.all([fs.copy('libs/expo-location', 'node_modules/expo-location'), fs.copy('libs/expo-application', 'node_modules/expo-application')]);
4 changes: 1 addition & 3 deletions src/services/NativeService/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@ export class NativeService {

// this usually last for a very long time. So we use a timeout to prevent it from blocking the app
const locationPromise = (async () => {
const location = (await Location.getLastKnownPositionAsync()) ?? await Location.getCurrentPositionAsync({
accuracy: Location.Accuracy.Lowest,
});
const location = await Location.getCurrentPositionAsync({ accuracy: Location.Accuracy.Lowest });
return location.coords;
})();

Expand Down

0 comments on commit 8069d99

Please sign in to comment.