Skip to content

Commit

Permalink
[TEST] CD: Setup CD pipeline on actions
Browse files Browse the repository at this point in the history
Signed-off-by: Arjun Ingole <[email protected]>
  • Loading branch information
Arjun-Ingole committed Oct 24, 2022
1 parent a41cb8b commit b334fb6
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 2 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Android CI
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 11
- name: Access OPENAI_API_KEY
env:
OPENAI_API_KEY: ${{secrets.OPENAI_API_KEY}}
run: echo API_KEY=\"$OPENAI_API_KEY\" > ./local.properties
- name: Assemble with Gradle
run: ./gradlew :app:assembleDebug
- uses: actions/upload-artifact@v2
with:
name: appDebug
path: app/build/outputs/apk/debug/app-debug.apk
10 changes: 9 additions & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ android {
vectorDrawables {
useSupportLibrary true
}
buildConfigField("String", "API_KEY", getApiKey())
}

buildTypes {
Expand Down Expand Up @@ -64,4 +65,11 @@ dependencies {
implementation "com.aallam.openai:openai-client:2.0.0"
implementation("androidx.navigation:navigation-compose:2.5.2")
implementation "com.google.accompanist:accompanist-systemuicontroller:0.25.1"
}
}

String getApiKey() {
def propFile = rootProject.file("./local.properties")
def properties = new Properties()
properties.load(new FileInputStream(propFile))
return properties['API_KEY']
}
3 changes: 2 additions & 1 deletion app/src/main/java/io/arjuningole/gpt/services/service.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ package io.arjuningole.gpt.services
import com.aallam.openai.api.completion.CompletionRequest
import com.aallam.openai.api.model.ModelId
import com.aallam.openai.client.OpenAI
import io.arjuningole.gpt.BuildConfig
import kotlinx.coroutines.*

val apiKey = ""
val apiKey = BuildConfig.API_KEY;
val openAI = OpenAI(apiKey)
var story = "Say Hello! Maybe"

Expand Down
Empty file modified gradlew
100644 → 100755
Empty file.

0 comments on commit b334fb6

Please sign in to comment.