Skip to content

Commit

Permalink
🔨 Add script for building releases (#328)
Browse files Browse the repository at this point in the history
  • Loading branch information
jheubuch authored Mar 1, 2024
1 parent 52b61f4 commit 0674079
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 8 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,6 @@ local.properties
/key.properties
/sentry.properties
/dev.properties
/keystore.properties
/**/release/*
*.jks
24 changes: 16 additions & 8 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,20 @@ android {
testInstrumentationRunner
}


signingConfigs {
release {
def keystorePropertiesFile = rootProject.file("keystore.properties")
def keystoreProperties = new Properties()
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))

storeFile file(keystoreProperties['storeFile'])
storePassword keystoreProperties['storePassword']
keyAlias keystoreProperties['keyAlias']
keyPassword keystoreProperties['keyPassword']
}
}

buildTypes {
release {
proguardFiles getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro"
Expand All @@ -53,6 +67,8 @@ android {
buildConfigField "String", "WEBHOOK_URL", "\"https://webhook.traewelldroid.de\""
buildConfigField "String", "UP_FCM_PROXY", "\"https://push.traewelldroid.de/FCM\""
manifestPlaceholders["SENTRY_DSN"] = "https://[email protected]/3"

signingConfig signingConfigs.release
}
debug {
buildConfigField "String", "OAUTH_REDIRECT_URL", "\"https://app.traewelldroid.de/oauth2redirect\""
Expand Down Expand Up @@ -94,14 +110,6 @@ android {
// versionNameSuffix "-foss"
}
}
signingConfigs {
release {
storeFile file("keystore.jks")
storePassword System.getenv("SIGNING_STORE_PASSWORD")
keyAlias System.getenv("SIGNING_KEY_ALIAS")
keyPassword System.getenv("SIGNING_KEY_PASSWORD")
}
}
}

dependencies {
Expand Down
10 changes: 10 additions & 0 deletions build-release.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
rm release/ -r -Force
mkdir release
./gradlew clean
./gradlew assembleFossRelease
mv app/build/outputs/apk/foss/release/app-foss-release.apk release/
./gradlew clean
./gradlew assemblePlayRelease
mv app/build/outputs/apk/play/release/app-play-release.apk release/
./gradlew bundlePlayRelease
mv app/build/outputs/bundle/playRelease/app-play-release.aab release/
4 changes: 4 additions & 0 deletions keystore.properties.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
storePassword=
keyPassword=
keyAlias=
storeFile=

0 comments on commit 0674079

Please sign in to comment.