Skip to content

Commit

Permalink
Fix release (#46)
Browse files Browse the repository at this point in the history
* compose bom alpha + getVersion in kotlin

* fix cast
  • Loading branch information
wiiznokes authored Jun 16, 2024
1 parent 873837a commit 4f549c4
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 21 deletions.
10 changes: 1 addition & 9 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@ jobs:

- name: Set app version
run: |
date +"%y.%m" > VERSION
echo "APP_VERSION=$(cat VERSION)" >> $GITHUB_ENV
echo "APP_VERSION=$(date +"%y.%m")" >> $GITHUB_ENV
- if: ${{ (github.event.inputs.is_nightly == 'true') || (github.event.inputs.is_nightly == '') }}
name: Setup options for nightly
Expand All @@ -50,13 +49,6 @@ jobs:
echo "VERSION_NAME=nightly" >> $GITHUB_ENV
echo "PRERELEASE=--prerelease" >> $GITHUB_ENV
- if: ${{ github.event.inputs.is_nightly == 'false' }}
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: Set version file
skip_checkout: true
skip_fetch: true
file_pattern: "VERSION"
- if: ${{ github.event.inputs.is_nightly == 'false' }}
name: Setup options for a new release
Expand Down
1 change: 0 additions & 1 deletion VERSION

This file was deleted.

24 changes: 16 additions & 8 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import java.io.BufferedReader
import java.io.InputStreamReader
import java.time.LocalDate
import java.time.format.DateTimeFormatter

plugins {
alias(libs.plugins.android.application)
Expand All @@ -16,20 +18,26 @@ android {
compileSdk = 34

defaultConfig {
applicationId = "io.github.wiiznokes.gitnote"
minSdk = 30
targetSdk = 34
versionCode = 1
versionName = File("VERSION").readText()

fun getGitHash(): String {
val command = "git rev-parse HEAD"
val command = arrayOf("git", "rev-parse", "HEAD")
val process = Runtime.getRuntime().exec(command)
val reader = BufferedReader(InputStreamReader(process.inputStream))

return reader.readLine()
}

fun getVersion(): String {
val currentDate = LocalDate.now()
val formatter = DateTimeFormatter.ofPattern("yy.MM")
return currentDate.format(formatter)
}

applicationId = "io.github.wiiznokes.gitnote"
minSdk = 30
targetSdk = 34
versionCode = 1
versionName = getVersion()

buildConfigField(
"String",
"GIT_HASH",
Expand Down Expand Up @@ -140,7 +148,7 @@ dependencies {
//implementation(libs.splash.screen)

// Compose
implementation(platform(libs.compose.bom))
implementation(platform(libs.compose.bom.alpha))
implementation(libs.compose.ui)
implementation(libs.compose.material)
implementation(libs.compose.material3)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ data class NoteFolder(
override fun equals(other: Any?): Boolean {
if (this === other) return true
if (other == null || this::class != other::class) return false
return id == (other as Note).id
return id == (other as NoteFolder).id
}
override fun hashCode(): Int = id
}
Expand Down
4 changes: 3 additions & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[versions]
agp = "8.4.2"
agp = "8.5.0"

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

# Compose
# https://central.sonatype.com/artifact/dev.chrisbanes.compose/compose-bom/versions
compose-bom-alpha = { group = "dev.chrisbanes.compose", name = "compose-bom", version = "2024.05.00-alpha03" }
compose-bom = { group = "androidx.compose", name = "compose-bom", version.ref = "compose-bom" }
compose-ui = { group = "androidx.compose.ui", name = "ui" }
compose-ui-preview = { group = "androidx.compose.ui", name = "ui-tooling-preview" }
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Wed Feb 28 02:22:38 CET 2024
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

0 comments on commit 4f549c4

Please sign in to comment.