Skip to content

Commit 5a3a822

Browse files
authored
Merge pull request #294 from synonymdev/chore/core-gh-package
chore: use bitkit-core from github packages
2 parents 5484979 + c69ff13 commit 5a3a822

File tree

7 files changed

+59
-7
lines changed

7 files changed

+59
-7
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ jobs:
4141

4242
- name: Build debug app
4343
env:
44+
GITHUB_ACTOR: ${{ github.actor }}
45+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4446
CHATWOOT_API: ${{ secrets.CHATWOOT_API }}
4547
run: ./gradlew assembleDevDebug
4648

.github/workflows/e2e.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ jobs:
3737

3838
- name: Build debug app
3939
env:
40+
GITHUB_ACTOR: ${{ github.actor }}
41+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4042
CHATWOOT_API: ${{ secrets.CHATWOOT_API }}
4143
E2E: true
4244
run: ./gradlew assembleDevDebug
@@ -123,7 +125,7 @@ jobs:
123125
emulator-options: -no-window -gpu swiftshader_indirect -no-snapshot -noaudio -no-boot-anim -camera-back none -camera-front none
124126
script: |
125127
# adb port forwarding for regtest
126-
adb reverse tcp:60001 tcp:60001
128+
adb reverse tcp:60001 tcp:60001
127129
cd bitkit-e2e-tests && npm run e2e:android -- --mochaOpts.grep "Can start onboarding"
128130
env:
129131
RECORD_VIDEO: true

.github/workflows/ui-tests.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,11 @@ jobs:
4242
- name: Make gradlew executable
4343
run: chmod +x gradlew
4444

45-
- name: Build for debug with gradle
45+
- name: Build debug app
46+
env:
47+
GITHUB_ACTOR: ${{ github.actor }}
48+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
49+
CHATWOOT_API: ${{ secrets.CHATWOOT_API }}
4650
run: |
4751
./gradlew assembleDevDebug assembleDevDebugAndroidTest
4852
ls -la app/build/outputs/apk/debug/

README.md

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,33 @@ This repository contains a **new native Android app** which is **not ready for p
1313

1414
## Development
1515

16-
**Prerequisites**
17-
1. Download `google-services.json` to `app/` from FCM Console.
16+
### Prerequisites
17+
18+
#### 1. Download `google-services.json` to `app/` from FCM Console.
19+
20+
#### 2. GitHub Packages setup
21+
22+
Some internal libraries are distributed via GitHub Packages. Configure credentials so Gradle can resolve them.
23+
24+
1) Create a GitHub token with `read:packages` scope.
25+
26+
2) Provide credentials for Gradle (choose one):
27+
28+
- Environment variables
29+
- `GITHUB_ACTOR` (your username)
30+
- `GITHUB_TOKEN` (token with `read:packages`)
31+
32+
- Or `~/.gradle/local.properties`
33+
- `gpr.user=YOUR_GITHUB_USERNAME`
34+
- `gpr.key=YOUR_GITHUB_TOKEN`
35+
36+
See also:
37+
- [bitkit-core android bindings](https://github.com/synonymdev/bitkit-core/tree/master/bindings/android#installation)
1838

1939
### References
2040

2141
- For LNURL dev testing see [bitkit-docker](https://github.com/ovitrif/bitkit-docker)
42+
- Bitkit Core Android bindings README: [synonymdev/bitkit-core — bindings/android/README.md](https://github.com/synonymdev/bitkit-core/blob/master/bindings/android/README.md)
2243

2344
### Linting
2445

app/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ dependencies {
197197
// Crypto
198198
implementation(libs.bouncycastle.provider.jdk)
199199
implementation(libs.ldk.node.android) { exclude(group = "net.java.dev.jna", module = "jna") }
200-
implementation(libs.bitkitcore) { exclude(group = "net.java.dev.jna", module = "jna") }
200+
implementation(libs.bitkitcore)
201201
// Firebase
202202
implementation(platform(libs.firebase.bom))
203203
implementation(libs.firebase.messaging)

gradle/libs.versions.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,7 @@ activity-compose = { module = "androidx.activity:activity-compose", version.ref
4646
appcompat = { module = "androidx.appcompat:appcompat", version.ref = "appcompat" }
4747
barcode-scanning = { module = "com.google.mlkit:barcode-scanning", version.ref = "barcodeScanning" }
4848
biometric = { module = "androidx.biometric:biometric", version.ref = "biometric" }
49-
#bitkitcore = { module = "com.synonym:bitkit-core-android", version = "0.1.9" } # mavenLocal
50-
bitkitcore = { module = "com.github.synonymdev:bitkit-core", version = "v0.1.9" } # jitpack
49+
bitkitcore = { module = "com.synonym:bitkit-core-android", version = "0.1.10" }
5150
bouncycastle-provider-jdk = { module = "org.bouncycastle:bcprov-jdk18on", version.ref = "bouncyCastle" }
5251
camera-camera2 = { module = "androidx.camera:camera-camera2", version.ref = "camera" }
5352
camera-lifecycle = { module = "androidx.camera:camera-lifecycle", version.ref = "camera" }

settings.gradle.kts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
import java.io.FileInputStream
2+
import java.util.Properties
3+
14
pluginManagement {
25
repositories {
36
google()
@@ -13,6 +16,27 @@ dependencyResolutionManagement {
1316
google()
1417
mavenCentral()
1518
maven("https://jitpack.io")
19+
maven {
20+
url = uri("https://maven.pkg.github.com/synonymdev/bitkit-core")
21+
credentials {
22+
23+
val localPropertiesFile = File(rootDir, "gradle.properties")
24+
val localProperties = Properties()
25+
26+
if (localPropertiesFile.exists()) {
27+
localProperties.load(FileInputStream(localPropertiesFile))
28+
}
29+
30+
username = System.getenv("GITHUB_ACTOR")
31+
?: localProperties.getProperty("gpr.user")
32+
?: providers.gradleProperty("gpr.user").orNull
33+
34+
35+
password = System.getenv("GITHUB_TOKEN")
36+
?: localProperties.getProperty("gpr.key")
37+
?: providers.gradleProperty("gpr.key").orNull
38+
}
39+
}
1640
}
1741
}
1842
rootProject.name = "bitkit-android"

0 commit comments

Comments
 (0)