Skip to content

Commit 4f549c4

Browse files
authored
Fix release (#46)
* compose bom alpha + getVersion in kotlin * fix cast
1 parent 873837a commit 4f549c4

File tree

6 files changed

+22
-21
lines changed

6 files changed

+22
-21
lines changed

.github/workflows/release.yml

+1-9
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,7 @@ jobs:
4040

4141
- name: Set app version
4242
run: |
43-
date +"%y.%m" > VERSION
44-
echo "APP_VERSION=$(cat VERSION)" >> $GITHUB_ENV
43+
echo "APP_VERSION=$(date +"%y.%m")" >> $GITHUB_ENV
4544
4645
- if: ${{ (github.event.inputs.is_nightly == 'true') || (github.event.inputs.is_nightly == '') }}
4746
name: Setup options for nightly
@@ -50,13 +49,6 @@ jobs:
5049
echo "VERSION_NAME=nightly" >> $GITHUB_ENV
5150
echo "PRERELEASE=--prerelease" >> $GITHUB_ENV
5251
53-
- if: ${{ github.event.inputs.is_nightly == 'false' }}
54-
uses: stefanzweifel/git-auto-commit-action@v5
55-
with:
56-
commit_message: Set version file
57-
skip_checkout: true
58-
skip_fetch: true
59-
file_pattern: "VERSION"
6052
6153
- if: ${{ github.event.inputs.is_nightly == 'false' }}
6254
name: Setup options for a new release

VERSION

-1
This file was deleted.

app/build.gradle.kts

+16-8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import java.io.BufferedReader
22
import java.io.InputStreamReader
3+
import java.time.LocalDate
4+
import java.time.format.DateTimeFormatter
35

46
plugins {
57
alias(libs.plugins.android.application)
@@ -16,20 +18,26 @@ android {
1618
compileSdk = 34
1719

1820
defaultConfig {
19-
applicationId = "io.github.wiiznokes.gitnote"
20-
minSdk = 30
21-
targetSdk = 34
22-
versionCode = 1
23-
versionName = File("VERSION").readText()
2421

2522
fun getGitHash(): String {
26-
val command = "git rev-parse HEAD"
23+
val command = arrayOf("git", "rev-parse", "HEAD")
2724
val process = Runtime.getRuntime().exec(command)
2825
val reader = BufferedReader(InputStreamReader(process.inputStream))
29-
3026
return reader.readLine()
3127
}
3228

29+
fun getVersion(): String {
30+
val currentDate = LocalDate.now()
31+
val formatter = DateTimeFormatter.ofPattern("yy.MM")
32+
return currentDate.format(formatter)
33+
}
34+
35+
applicationId = "io.github.wiiznokes.gitnote"
36+
minSdk = 30
37+
targetSdk = 34
38+
versionCode = 1
39+
versionName = getVersion()
40+
3341
buildConfigField(
3442
"String",
3543
"GIT_HASH",
@@ -140,7 +148,7 @@ dependencies {
140148
//implementation(libs.splash.screen)
141149

142150
// Compose
143-
implementation(platform(libs.compose.bom))
151+
implementation(platform(libs.compose.bom.alpha))
144152
implementation(libs.compose.ui)
145153
implementation(libs.compose.material)
146154
implementation(libs.compose.material3)

app/src/main/java/io/github/wiiznokes/gitnote/data/room/Schema.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ data class NoteFolder(
5959
override fun equals(other: Any?): Boolean {
6060
if (this === other) return true
6161
if (other == null || this::class != other::class) return false
62-
return id == (other as Note).id
62+
return id == (other as NoteFolder).id
6363
}
6464
override fun hashCode(): Int = id
6565
}

gradle/libs.versions.toml

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[versions]
2-
agp = "8.4.2"
2+
agp = "8.5.0"
33

44
# https://developer.android.com/jetpack/androidx/releases/compose-kotlin?hl=fr
55
kotlin = "1.9.24"
@@ -27,6 +27,8 @@ compose-activity = { group = "androidx.activity", name = "activity-compose", ver
2727
datastore-preferences = { group = "androidx.datastore", name = "datastore-preferences", version = "1.1.1" }
2828

2929
# Compose
30+
# https://central.sonatype.com/artifact/dev.chrisbanes.compose/compose-bom/versions
31+
compose-bom-alpha = { group = "dev.chrisbanes.compose", name = "compose-bom", version = "2024.05.00-alpha03" }
3032
compose-bom = { group = "androidx.compose", name = "compose-bom", version.ref = "compose-bom" }
3133
compose-ui = { group = "androidx.compose.ui", name = "ui" }
3234
compose-ui-preview = { group = "androidx.compose.ui", name = "ui-tooling-preview" }
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#Wed Feb 28 02:22:38 CET 2024
22
distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
4-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip
4+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
55
zipStoreBase=GRADLE_USER_HOME
66
zipStorePath=wrapper/dists

0 commit comments

Comments
 (0)