Skip to content

Commit

Permalink
optimize code
Browse files Browse the repository at this point in the history
  • Loading branch information
leavesCZY committed Jun 9, 2024
1 parent d38d2d2 commit f6afb67
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 34 deletions.
Original file line number Diff line number Diff line change
@@ -1,39 +1,38 @@
name: Android CI
name: create release

on:
push:
branches: [ master ]
paths:
- '**/WorkflowsTrigger.kt'

env:
TZ: Asia/Shanghai
- "**/workflows-trigger.properties"

jobs:
build:

runs-on: ubuntu-latest

steps:
- name: checkout
uses: actions/checkout@v3

- name: set up jdk 17
uses: actions/setup-java@v3
- name: setup jdk
uses: actions/setup-java@v4
with:
java-version: "17"
java-version: "18"
distribution: "oracle"
cache: gradle
architecture: x64

- name: checkout
uses: actions/checkout@v4

- name: grant execute permission for gradlew
run: chmod +x gradlew

- name: build apk with gradle
run: ./gradlew app:assembleRelease
- name: assembleRelease
run: ./gradlew assembleRelease

- name: get current time
id: currentTime
run: echo "time=$(date +'%Y.%m.%d')" >> $GITHUB_OUTPUT
uses: josStorer/get-current-time@v2
with:
format: YYYY.MM.DD
utcOffset: "+08:00"

- name: create a release
uses: ncipollo/release-action@v1
Expand All @@ -44,5 +43,5 @@ jobs:
artifactErrorsFailBuild: true
generateReleaseNotes: false
token: ${{ secrets.ACTION_TOKEN }}
name: v${{ steps.currentTime.outputs.time }}
tag: ${{ steps.currentTime.outputs.time }}
tag: ${{ steps.currentTime.outputs.formattedTime }}
name: v${{ steps.currentTime.outputs.formattedTime }}
6 changes: 3 additions & 3 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,11 @@ android {
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
sourceCompatibility = JavaVersion.VERSION_18
targetCompatibility = JavaVersion.VERSION_18
}
kotlinOptions {
jvmTarget = "1.8"
jvmTarget = JavaVersion.VERSION_18.toString()
}
packaging {
jniLibs {
Expand Down
23 changes: 11 additions & 12 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,21 +1,26 @@
[versions]
android-plugin = "8.4.0"
kotlin-plugin = "1.9.23"
android-plugin = "8.4.1"
kotlin-plugin = "2.0.0"

junit = "4.13.2"
androidx-junit = "1.1.5"
androidx-espresso = "3.5.1"

androidx-appcompat = "1.6.1"
androidx-appcompat = "1.7.0"
androidx-constraintlayout = "2.1.4"
androidx-recyclerview = "1.3.2"
androidx-lifecycle-runtime = "2.7.0"
androidx-lifecycle-runtime = "2.8.1"

google-material = "1.12.0"

kotlinx-coroutines = "1.8.0"
kotlinx-coroutines = "1.8.1"

[plugins]
android-application = { id = "com.android.application", version.ref = "android-plugin" }
kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin-plugin" }

[libraries]
junit = { module = "junit:junit", version.ref = "junit" }
androidx-junit = { module = "androidx.test.ext:junit", version.ref = "androidx-junit" }
androidx-espresso-core = { module = "androidx.test.espresso:espresso-core", version.ref = "androidx-espresso" }

Expand All @@ -26,10 +31,4 @@ androidx-constraintlayout = { module = "androidx.constraintlayout:constraintlayo

google-material = { module = "com.google.android.material:material", version.ref = "google-material" }

kotlinx-coroutines = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-android", version.ref = "kotlinx-coroutines" }

junit = { module = "junit:junit", version.ref = "junit" }

[plugins]
android-application = { id = "com.android.application", version.ref = "android-plugin" }
kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin-plugin" }
kotlinx-coroutines = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-android", version.ref = "kotlinx-coroutines" }
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
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
1 change: 1 addition & 0 deletions workflows-trigger.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
trigger=1

0 comments on commit f6afb67

Please sign in to comment.