Skip to content

Commit

Permalink
Update project
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelbel committed Nov 19, 2024
1 parent d3fa2c1 commit 8b50f81
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 15 deletions.
31 changes: 18 additions & 13 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Check Commit CI
name: CI

on:
push:
Expand All @@ -14,9 +14,24 @@ concurrency:
cancel-in-progress: false

jobs:
build:
job-common:
runs-on: ubuntu-latest
outputs:
SHORT_SHA: ${{ steps.expose_sha.outputs.short_sha }}
steps:
- name: expose short commit sha
id: expose_sha
run: |
SHORT_SHA=${GITHUB_SHA::7}
echo "short_sha=$SHORT_SHA" >> $GITHUB_ENV
echo "SHORT_SHA=$SHORT_SHA" >> $GITHUB_OUTPUT
build-android:
needs: job-common
runs-on: ubuntu-latest
timeout-minutes: 60
env:
SHORT_SHA: ${{ needs.job-common.outputs.SHORT_SHA }}
steps:
- name: checkout repo
uses: actions/checkout@v4
Expand All @@ -30,7 +45,7 @@ jobs:
java-version: '21'

- name: cache gradle dependencies
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/.gradle/caches
key: gradle-${{ runner.os }}-${{ hashFiles('/*.gradle*', '/gradle-wrapper.properties') }}
Expand Down Expand Up @@ -70,20 +85,10 @@ jobs:
VERSION_CODE=$(./gradlew printVersionCode -q)
echo "VERSION_CODE=$VERSION_CODE" >> $GITHUB_ENV
- name: list all apk files
run: |
echo "APKs:"
for apk in $(find composeApp/build/outputs/apk -name '*.apk'); do
echo "$apk"
done
- name: expose apk path
run: |
echo "APK_PATH=$(find composeApp/build/outputs/apk -name '*.apk' -type f -printf '%T@ %p\n' | sort -n | tail -1 | cut -d' ' -f2)" >> $GITHUB_ENV
- name: expose short commit sha
run: echo "SHORT_SHA=${GITHUB_SHA::7}" >> $GITHUB_ENV

- name: send telegram message
env:
TELEGRAM_TOKEN: ${{ secrets.TELEGRAM_TOKEN }}
Expand Down
5 changes: 4 additions & 1 deletion composeApp/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ android {
targetSdk = libs.versions.target.sdk.get().toInt()
versionName = "1.0.0"
versionCode = gitCommitsCount
setProperty("archivesBaseName", "KmpTemplate-v$versionName($versionCode)")
}
packaging {
resources {
Expand Down Expand Up @@ -154,6 +153,10 @@ compose {
}
}

base {
archivesName.set("KmpTemplate-v${android.defaultConfig.versionName}(${android.defaultConfig.versionCode})")
}

tasks.register("printVersionName") {
doLast {
println(android.defaultConfig.versionName)
Expand Down
2 changes: 1 addition & 1 deletion composeApp/src/androidMain/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<resources>
<string name="app_name">kmp-template</string>
<string name="app_name">KmpTemplate</string>
</resources>

0 comments on commit 8b50f81

Please sign in to comment.