ci: fix missing file issue
This commit is contained in:
parent
4c1e7d8e61
commit
deb45df0d3
|
|
@ -9,28 +9,31 @@ jobs:
|
||||||
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
env:
|
||||||
|
RVX_SENTRY_DSN: ""
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- name: set up JDK 11
|
- name: set up JDK 11
|
||||||
uses: actions/setup-java@v3
|
uses: actions/setup-java@v3
|
||||||
with:
|
with:
|
||||||
java-version: '11'
|
java-version: '11'
|
||||||
distribution: 'microsoft'
|
distribution: 'microsoft'
|
||||||
cache: gradle
|
cache: gradle
|
||||||
|
|
||||||
|
|
||||||
- name: Setup Android SDK
|
- name: Setup Android SDK
|
||||||
uses: android-actions/setup-android@v2
|
uses: android-actions/setup-android@v2
|
||||||
|
|
||||||
- name: Grant execute permission for gradlew
|
- name: Grant execute permission for gradlew
|
||||||
run: chmod +x gradlew
|
run: chmod +x gradlew
|
||||||
|
|
||||||
- name: Build with Gradle
|
- name: Build with Gradle
|
||||||
run: ./gradlew --no-daemon assembleDebug
|
run: ./gradlew --no-daemon assembleDebug
|
||||||
|
|
||||||
- name: Archive debug APK
|
- name: Archive debug APK
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: debug-apk
|
name: debug-apk
|
||||||
path: |
|
path: |
|
||||||
app/build/outputs/apk/debug/app-debug.apk
|
app/build/outputs/apk/debug/app-debug.apk
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ plugins {
|
||||||
id 'kotlin-kapt'
|
id 'kotlin-kapt'
|
||||||
}
|
}
|
||||||
|
|
||||||
def property(String fileName, String propertyName) {
|
def property(String fileName, String propertyName, String fallbackEnv = null) {
|
||||||
def propsFile = rootProject.file(fileName)
|
def propsFile = rootProject.file(fileName)
|
||||||
if (propsFile.exists()) {
|
if (propsFile.exists()) {
|
||||||
def props = new Properties()
|
def props = new Properties()
|
||||||
|
|
@ -17,10 +17,28 @@ def property(String fileName, String propertyName) {
|
||||||
if (props[propertyName] != null) {
|
if (props[propertyName] != null) {
|
||||||
return props[propertyName]
|
return props[propertyName]
|
||||||
} else {
|
} else {
|
||||||
throw new GradleException("'" + propertyName + "' not found in '" + fileName + "'")
|
logger.warn("Property '$propertyName' not found in '$fileName'. Attempting to use environment variable '$fallbackEnv'")
|
||||||
|
if (fallbackEnv != null) {
|
||||||
|
def env = System.getenv(fallbackEnv)
|
||||||
|
if (env != null) {
|
||||||
|
return env
|
||||||
|
} else {
|
||||||
|
logger.warn("Environment variable '$fallbackEnv' not found either. Returning null")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
throw new GradleException("'" + fileName + "' not found in app/, please create it from '" + fileName + ".example'")
|
logger.warn("Properties file '$fileName' not found. Attempting to use environment variable '$fallbackEnv'")
|
||||||
|
if (fallbackEnv != null) {
|
||||||
|
def env = System.getenv(fallbackEnv)
|
||||||
|
if (env != null) {
|
||||||
|
return env
|
||||||
|
} else {
|
||||||
|
logger.warn("Environment variable '$fallbackEnv' not found either. Returning null")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -45,11 +63,11 @@ android {
|
||||||
minifyEnabled true
|
minifyEnabled true
|
||||||
shrinkResources true
|
shrinkResources true
|
||||||
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
|
||||||
buildConfigField "String", "SENTRY_DSN", "\"${property('revoltbuild.properties', 'sentry.dsn')}\""
|
buildConfigField "String", "SENTRY_DSN", "\"${property('revoltbuild.properties', 'sentry.dsn', 'RVX_SENTRY_DSN')}\""
|
||||||
}
|
}
|
||||||
|
|
||||||
debug {
|
debug {
|
||||||
buildConfigField "String", "SENTRY_DSN", "\"${property('revoltbuild.properties', 'sentry.dsn')}\""
|
buildConfigField "String", "SENTRY_DSN", "\"${property('revoltbuild.properties', 'sentry.dsn', 'RVX_SENTRY_DSN')}\""
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
compileOptions {
|
compileOptions {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue