Skip to content

Commit

Permalink
Update CHANGELOG and simplify versionCode calculation (#134)
Browse files Browse the repository at this point in the history
* Simplify versionCode calculation

* Update CHANGELOG
  • Loading branch information
vanshg authored Jun 30, 2023
1 parent 9db42eb commit e975cb9
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 26 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/publish_play_store_update.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ jobs:
timeout-minutes: 10
steps:
- uses: actions/checkout@v3
# Fetch all history so that we can calculate the version code
with:
fetch-depth: 0
- uses: actions/setup-java@v3
with:
distribution: temurin
Expand Down Expand Up @@ -43,11 +46,18 @@ jobs:
id: short_sha
run: |
echo "short_sha=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
- name: Calculate Version Code
id: version_code
run: |
VERSION_CODE=$(git rev-list --count HEAD)
echo "Version Code for this build is $VERSION_CODE"
echo "version_code=$VERSION_CODE" >> $GITHUB_OUTPUT
- name: Assemble
uses: gradle/gradle-build-action@v2
with:
arguments: bundleRelease
env:
ORG_GRADLE_PROJECT_VERSION_CODE: ${{ steps.version_code.outputs.version_code }}
ORG_GRADLE_PROJECT_SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
ORG_GRADLE_PROJECT_uploadKeystorePassword: ${{ secrets.UPLOAD_KEYSTORE_PASSWORD }}
- name: Deploy Sample App to Play Store Internal Testing Track
Expand Down
27 changes: 21 additions & 6 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
# Changelog

## 10.0.0-beta03 (Unreleased)
## 10.0.0-beta04 (unreleased)

### Added

### Fixed

### Changed

### Removed

## 10.0.0-beta03

### Added
- Biometric KYC
Expand All @@ -15,17 +25,22 @@
- Don't report IDE Jetpack Compose Preview crashes to Sentry

### Changed
- Breaking: renamed SmartSelfie Registration to SmartSelfie Enrollment
- Compile against API level 34
- Bump AndroidX Activity to 1.7.2
- Bump AndroidX Fragment to 1.6.0
- Bump Gradle to 8.0.2
- Breaking: Renamed SmartSelfie Registration to SmartSelfie Enrollment
- Breaking: Removed "Screen" suffix from SmartSelfie Composables
- Tweak selfie progress indicator animation
- Minor update to default colors to add contrast
- Submit color liveness images instead of grayscale
- Update SmartSelfie™ directives copy to be more succinct
- Changed the order of arguments in Composables to ensure required arguments come first and so that
Modifier is the first optional argument
- Compile against API level 34
- Bump Gradle to 8.0.2
- Bump Kotlin to 1.8.22
- Bump AndroidX Activity to 1.7.2
- Bump AndroidX Fragment to 1.6.0
- Bump Compose BOM to 2023.06.01
- Bump Camposer to 0.2.2
- Bump Sentry to 6.24

## 10.0.0-beta02

Expand Down
21 changes: 1 addition & 20 deletions sample/sample.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
@file:Suppress("UnstableApiUsage")

import java.io.ByteArrayOutputStream

plugins {
alias(libs.plugins.android.application)
alias(libs.plugins.kotlin.android)
Expand All @@ -17,7 +15,7 @@ android {
applicationId = "com.smileidentity.sample"
minSdk = 21
targetSdk = 34
versionCode = numberOfCommitsOnMain
versionCode = findProperty("VERSION_CODE") as? Int ?: 1
// Include the SDK version in the app version name
versionName = "1.2.0_sdk-" + project(":lib").version.toString()

Expand Down Expand Up @@ -86,23 +84,6 @@ android {
}
}

/**
* The versionCode is calculated by the number of commits on the main branch. This fails on PRs,
* but the versionCode is only relevant on main anyways, so return a default value of 1.
*/
val numberOfCommitsOnMain: Int
get() = try {
val stdout = ByteArrayOutputStream()
project.exec {
commandLine("git", "rev-list", "--count", "main")
standardOutput = stdout
}
stdout.toString().trim().toInt()
} catch (e: Exception) {
println(e.message)
1
}

val checkSmileConfigFileTaskName = "checkSmileConfigFile"
tasks.register(checkSmileConfigFileTaskName) {
doLast {
Expand Down

0 comments on commit e975cb9

Please sign in to comment.