Skip to content

Commit 36c2dbe

Browse files
committed
Fix ci
1 parent 6ab59e2 commit 36c2dbe

File tree

4 files changed

+87
-257
lines changed

4 files changed

+87
-257
lines changed

.github/workflows/build.yml

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
name: Build the app
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
env:
10+
BRANCH_NAME: ${{ github.ref_name }}
11+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
12+
13+
14+
jobs:
15+
check:
16+
if: ${{ startsWith(github.actor, 'dependabot') }}
17+
environment: Development
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: actions/checkout@v4
21+
22+
- name: Set up JDK 17
23+
uses: actions/setup-java@v4
24+
with:
25+
java-version: '17'
26+
distribution: 'adopt'
27+
cache: gradle
28+
29+
- name: Validate Gradle wrapper
30+
uses: gradle/actions/wrapper-validation@v3
31+
32+
- name: Build debug APK
33+
run: ./gradlew assembleDebug
34+
35+
build:
36+
environment: Development
37+
runs-on: ubuntu-latest
38+
steps:
39+
- uses: actions/checkout@v4
40+
41+
- name: Set up JDK 17
42+
uses: actions/setup-java@v4
43+
with:
44+
java-version: '17'
45+
distribution: 'adopt'
46+
cache: gradle
47+
48+
- name: Validate Gradle wrapper
49+
uses: gradle/actions/wrapper-validation@v3
50+
51+
- name: Decrypt the keystore for signing
52+
run: |
53+
echo "${{ secrets.KEYSTORE_ENCRYPTED }}" > keystore.asc
54+
gpg -d --passphrase "${{ secrets.KEYSTORE_PASSWORD }}" --batch keystore.asc > keystore.jks
55+
56+
- name: Build release APK
57+
run: ./gradlew assembleRelease
58+
59+
- name: Upload APK
60+
uses: actions/upload-artifact@v4
61+
with:
62+
name: app-release
63+
path: ./app/build/outputs/apk/release/app-release.apk
64+
lint:
65+
needs: build
66+
environment: Development
67+
runs-on: ubuntu-latest
68+
steps:
69+
- uses: actions/checkout@v4
70+
71+
- name: Set up JDK 17
72+
uses: actions/setup-java@v4
73+
with:
74+
java-version: '17'
75+
distribution: 'adopt'
76+
77+
- name: Run linter
78+
run: ./gradlew lint
79+
80+
- uses: actions/upload-artifact@v4
81+
with:
82+
name: lint-results
83+
path: ./app/build/reports/*.html

.github/workflows/build_apk.yml

Lines changed: 0 additions & 83 deletions
This file was deleted.

.github/workflows/release.yml

Lines changed: 0 additions & 103 deletions
This file was deleted.

app/build.gradle.kts

Lines changed: 4 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,3 @@
1-
import com.android.build.gradle.internal.tasks.factory.dependsOn
2-
import java.util.Properties
3-
4-
val localProps = Properties().apply {
5-
file("$rootDir/local.properties").takeIf { it.exists() }?.inputStream()?.use { load(it) }
6-
}
7-
fun localProp(key: String): String? = localProps.getProperty(key)
8-
val devKeystorePath = "${layout.buildDirectory.asFile.get().absolutePath}/drop-keystore.jks"
9-
val devKeystorePassword = localProp("dev.keystore.password") ?: "defaultPassword123"
10-
val devKeyAlias = "drop-key"
11-
val devDname = localProp("dev.keystore.dname") ?: "CN=Unknown, OU=Dev, O=Unknown, L=City, ST=State, C=XX"
12-
131
plugins {
142
kotlin("kapt") version "2.2.0"
153
kotlin("plugin.serialization") version "1.9.23"
@@ -37,13 +25,13 @@ android {
3725
applicationId = "dev.arkbuilders.drop.app"
3826
minSdk = 29
3927
targetSdk = 36
40-
versionCode = getVersionCode()
41-
versionName = getVersionName()
28+
versionCode = 1
29+
versionName = "1.0"
4230

4331
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
4432

45-
// Play Store metadata
46-
setProperty("archivesBaseName", "drop-v$versionName")
33+
34+
setProperty("archivesBaseName", "ark-drop")
4735
}
4836

4937
buildTypes {
@@ -113,13 +101,6 @@ android {
113101
}
114102
}
115103

116-
play {
117-
serviceAccountCredentials.set(file("play-store-credentials.json"))
118-
track.set("internal") // Start with internal testing
119-
releaseStatus.set(com.github.triplet.gradle.androidpublisher.ReleaseStatus.DRAFT)
120-
defaultToAppBundles.set(true)
121-
}
122-
123104
dependencies {
124105
implementation(libs.androidx.core.ktx)
125106
implementation(libs.androidx.lifecycle.runtime.ktx)
@@ -196,55 +177,7 @@ kapt {
196177
correctErrorTypes = true
197178
}
198179

199-
fun getVersionCode(): Int {
200-
val versionCode = System.getenv("VERSION_CODE")?.toIntOrNull()
201-
return versionCode ?: (System.currentTimeMillis() / 1000).toInt()
202-
}
203-
204-
fun getVersionName(): String {
205-
val versionName = System.getenv("VERSION_NAME")
206-
return versionName ?: "1.0.0"
207-
}
208-
209180
tasks.named<Delete>("clean") {
210181
delete(fileTree("$projectDir/src/main/jniLibs"))
211182
}
212183

213-
tasks.register<Exec>("generateDevKeystore") {
214-
doFirst {
215-
mkdir(layout.buildDirectory)
216-
}
217-
val keystoreFile = file(devKeystorePath)
218-
commandLine = if (keystoreFile.exists()) {
219-
listOf("echo", "\"Development keystore already exists.\"")
220-
} else {
221-
listOf(
222-
"keytool", "-genkeypair",
223-
"-alias", devKeyAlias,
224-
"-keyalg", "RSA",
225-
"-keysize", "2048",
226-
"-validity", "10000",
227-
"-keystore", devKeystorePath,
228-
"-storepass", devKeystorePassword,
229-
"-keypass", devKeystorePassword,
230-
"-dname", devDname
231-
)
232-
}
233-
}
234-
235-
tasks.named("preBuild").dependsOn("generateDevKeystore")
236-
237-
// Task to generate release notes
238-
tasks.register("generateReleaseNotes") {
239-
doLast {
240-
val releaseNotesFile = file("fastlane/metadata/android/en-US/changelogs/${getVersionCode()}.txt")
241-
releaseNotesFile.parentFile.mkdirs()
242-
releaseNotesFile.writeText("""
243-
• Initial release of Drop
244-
• Secure file sharing between devices
245-
• Profile management with custom avatars
246-
• Transfer history tracking
247-
• QR code sharing for easy connections
248-
""".trimIndent())
249-
}
250-
}

0 commit comments

Comments
 (0)