Skip to content

Commit

Permalink
gh-action: auto version codes for alpha
Browse files Browse the repository at this point in the history
  • Loading branch information
ignoramous authored Mar 1, 2024
1 parent a170393 commit ae3008e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@ jobs:
ALPHA_KS_ALIAS: ${{ vars.ALPHA_KS_ALIAS }}
ALPHA_KS_FILE: ${{ vars.ALPHA_KS_FILE }}
ALPHA_KS_STORE_PASSPHRASE: ${{ secrets.ALPHA_KS_STORE_PASSPHRASE }}
ALPHA_KS_PASSPHRASE: $ {{ secrets.ALPHA_KS_PASSPHRASE }}
ALPHA_KS_PASSPHRASE: ${{ secrets.ALPHA_KS_PASSPHRASE }}
VERSION_CODE: ${{ github.run_number }}
# version-code: archive.is/y8uCB

# github.com/actions/upload-artifact
- name: Artifact
Expand Down
10 changes: 6 additions & 4 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ android {
alpha {
keyAlias System.getenv("ALPHA_KS_ALIAS") // rdnsAlpha
keyPassword System.getenv("ALPHA_KS_PASSPHRASE")
storeFile System.getenv("ALPHA_KS_FILE") // rdnsAlpha.jks in app/
// https://stackoverflow.com/a/34640602
storeFile file(String.valueOf(System.getenv("ALPHA_KS_FILE"))) // rdnsAlpha.jks in app/
storePassword System.getenv("ALPHA_KS_STORE_PASSPHRASE")
}
}
Expand All @@ -72,6 +73,7 @@ android {
minifyEnabled true
shrinkResources true
signingConfig signingConfigs.alpha
versionCode System.getenv("VERSION_CODE")
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
Expand Down Expand Up @@ -121,9 +123,9 @@ android {
dimension "releaseType"
// getPackageInfo().versionCode not returning the correct value (in prod builds) when
// value is set in AndroidManifest.xml so setting it here
versionCode = 33
versionName = gitVersion
vectorDrawables.useSupportLibrary = true
versionCode System.getenv("VERSION_CODE")
versionName gitVersion
vectorDrawables.useSupportLibrary true
}
}
lintOptions {
Expand Down

0 comments on commit ae3008e

Please sign in to comment.