Skip to content

Commit

Permalink
build: publish bundles
Browse files Browse the repository at this point in the history
  • Loading branch information
yuriykulikov committed Apr 29, 2023
1 parent fd642fa commit 9212f17
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 35 deletions.
65 changes: 32 additions & 33 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,30 +66,26 @@ jobs:
distribution: 'adopt'
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Assemble
run: ./gradlew assembleDevelopRelease
- name: Sign develop APK
uses: r0adkll/sign-android-release@v1
# ID used to access action output
id: sign_develop_app
with:
releaseDirectory: app/build/outputs/apk/develop/release
signingKeyBase64: ${{ secrets.SIGNING_KEY }}
alias: ${{ secrets.ALIAS }}
keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }}
keyPassword: ${{ secrets.KEY_PASSWORD }}
#- name: Upload signed app
# uses: actions/upload-artifact@v2
# with:
# name: Signed develop release apk
# path: ${{steps.sign_develop_app.outputs.signedReleaseFile}}
- name: Publish to google play
- name: Extract upload store
run: 'echo "$UPLOAD_STORE_BASE64" | base64 --decode > app/upload-keystore.jks'
shell: bash
env:
UPLOAD_STORE_BASE64: ${{secrets.UPLOAD_STORE_BASE64}}
- name: Bundle develop
if: github.ref == 'refs/heads/develop'
run: ./gradlew :app:bundleDevelopRelease
env:
UPLOAD_KEYSTORE_PASSWORD: ${{secrets.UPLOAD_KEYSTORE_PASSWORD}}
UPLOAD_KEY_ALIAS: ${{secrets.UPLOAD_KEY_ALIAS}}
UPLOAD_KEY_PASSWORD: ${{secrets.UPLOAD_KEY_PASSWORD}}
- name: Publish develop to google play
if: github.ref == 'refs/heads/develop'
uses: r0adkll/[email protected]
continue-on-error: true
with:
serviceAccountJsonPlainText: ${{ secrets.SERVICE_ACCOUNT_JSON_PLAIN_TEXT }}
packageName: com.better.alarm
releaseFiles: ${{steps.sign_develop_app.outputs.signedReleaseFile}}
releaseFiles: app/build/outputs/bundle/developRelease/app-develop-release.aab
track: internal
inAppUpdatePriority: 2
# whatsNewDirectory: distribution/whatsnew
Expand All @@ -112,24 +108,27 @@ jobs:
distribution: 'adopt'
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Assemble
run: ./gradlew assemblePremiumRelease
- name: Sign premium APK
uses: r0adkll/sign-android-release@v1
# ID used to access action output
id: sign_premium_app
with:
releaseDirectory: app/build/outputs/apk/premium/release
signingKeyBase64: ${{ secrets.SIGNING_KEY }}
alias: ${{ secrets.ALIAS }}
keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }}
keyPassword: ${{ secrets.KEY_PASSWORD }}
- name: Publish to google play
- name: Extract upload store
run: 'echo "$UPLOAD_STORE_BASE64" | base64 --decode > app/upload-keystore.jks'
shell: bash
env:
UPLOAD_STORE_BASE64: ${{secrets.UPLOAD_STORE_BASE64}}
- name: Bundle premium
if: github.ref == 'refs/heads/develop'
run: ./gradlew :app:bundlePremiumRelease
env:
UPLOAD_KEYSTORE_PASSWORD: ${{secrets.UPLOAD_KEYSTORE_PASSWORD}}
UPLOAD_KEY_ALIAS: ${{secrets.UPLOAD_KEY_ALIAS}}
UPLOAD_KEY_PASSWORD: ${{secrets.UPLOAD_KEY_PASSWORD}}
- name: Publish premium to google play
if: github.ref == 'refs/heads/develop'
uses: r0adkll/[email protected]
continue-on-error: true
with:
serviceAccountJsonPlainText: ${{ secrets.SERVICE_ACCOUNT_JSON_PLAIN_TEXT }}
packageName: com.premium.alarm
releaseFiles: ${{steps.sign_premium_app.outputs.signedReleaseFile}}
releaseFiles: app/build/outputs/bundle/premiumRelease/app-premium-release.aab
track: internal
inAppUpdatePriority: 2
# whatsNewDirectory: distribution/whatsnew
# mappingFile: app/build/outputs/mapping/release/mapping.txt
14 changes: 12 additions & 2 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,12 @@ val acraEmail =
?.substringAfter("=")
?: System.getenv()["ACRA_EMAIL"] ?: ""

@Suppress("UnstableApiUsage")
android {
compileSdk = 33
defaultConfig {
versionCode = 31402
versionName = "3.14.02"
versionCode = 31403
versionName = "3.14.03"
applicationId = "com.better.alarm"
minSdk = 16
targetSdk = 33
Expand All @@ -88,6 +89,14 @@ android {
}
namespace = "com.better.alarm"
testNamespace = "com.better.alarm.debug"
signingConfigs {
create("release") {
storeFile = file("upload-keystore.jks")
storePassword = System.getenv("UPLOAD_KEYSTORE_PASSWORD")
keyAlias = System.getenv("UPLOAD_KEY_ALIAS")
keyPassword = System.getenv("UPLOAD_KEY_PASSWORD")
}
}
buildTypes {
getByName("debug") {
enableUnitTestCoverage = true
Expand All @@ -99,6 +108,7 @@ android {
isMinifyEnabled = false
proguardFiles(getDefaultProguardFile("proguard-android.txt"), "proguard-rules.txt")
buildConfigField("String", "ACRA_EMAIL", "\"$acraEmail\"")
getByName("release") { signingConfig = signingConfigs.getByName("release") }
}
}

Expand Down

0 comments on commit 9212f17

Please sign in to comment.