diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 797c6d9..6724c48 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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 @@ -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 diff --git a/VERSION b/VERSION deleted file mode 100644 index 7d9d1a1..0000000 --- a/VERSION +++ /dev/null @@ -1 +0,0 @@ -24.06 diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 501cf2b..2a0610d 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -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) @@ -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", @@ -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) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 5c28f6a..e29dfe6 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -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" @@ -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" } diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 89a376f..6e90904 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -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