diff --git a/.github/workflows/create_release.yml b/.github/workflows/create_release.yml index 425a40e..62f8a08 100644 --- a/.github/workflows/create_release.yml +++ b/.github/workflows/create_release.yml @@ -6,19 +6,11 @@ on: paths: - "**/workflows-trigger.properties" -jobs: +env: + PACKAGE_VERSION: 1.0.0 + V_PACKAGE_VERSION: v1.0.0 - current-time: - runs-on: ubuntu-latest - name: get current time - outputs: - currentTime: ${{steps.currentTime.outputs.formattedTime}} - steps: - - id: currentTime - uses: josStorer/get-current-time@v2 - with: - format: YYYY.MM.DD - utcOffset: "+08:00" +jobs: create-release-distribution: strategy: @@ -26,24 +18,23 @@ jobs: os: [ windows-latest , ubuntu-latest , macos-13 , macos-14 ] runs-on: ${{ matrix.os }} name: create release distribution - needs: current-time steps: - if: matrix.os != 'macos-14' name: setup jdk uses: actions/setup-java@v4 with: - java-version: "18" distribution: "zulu" + java-version: "18" architecture: x64 - if: matrix.os == 'macos-14' name: setup jdk uses: actions/setup-java@v4 with: - java-version: "18" distribution: "zulu" - architecture: aarch64 + java-version: "18" + architecture: x64 - name: checkout uses: actions/checkout@v4 @@ -57,40 +48,46 @@ jobs: - if: matrix.os == 'windows-latest' name: rename File run: | - mv ./build/compose/binaries/main-release/exe/compose-multiplatform-xlog-decode-1.0.0.exe ./build/compose/binaries/main-release/exe/compose-multiplatform-xlog-decode-windows-x64.exe + mv ./build/compose/binaries/main-release/exe/compose-multiplatform-xlog-decode-${{env.PACKAGE_VERSION}}.exe ./build/compose/binaries/main-release/exe/compose-multiplatform-xlog-decode-${{env.V_PACKAGE_VERSION}}-windows-x86-64.exe - if: matrix.os == 'windows-latest' name: zip AppImage uses: thedoctor0/zip-release@0.7.6 with: type: "zip" - filename: "compose-multiplatform-xlog-decode-windows-x64.zip" + filename: "compose-multiplatform-xlog-decode-${{env.V_PACKAGE_VERSION}}-windows-x86-64.zip" directory: "./build/compose/binaries/main-release/app/compose-multiplatform-xlog-decode" - if: matrix.os == 'ubuntu-latest' name: rename File run: | - mv /home/runner/work/compose-multiplatform-xlog-decode/compose-multiplatform-xlog-decode/build/compose/binaries/main-release/deb/compose-multiplatform-xlog-decode_1.0.0_amd64.deb /home/runner/work/compose-multiplatform-xlog-decode/compose-multiplatform-xlog-decode/build/compose/binaries/main-release/deb/compose-multiplatform-xlog-decode-linux-amd64.deb - mv /home/runner/work/compose-multiplatform-xlog-decode/compose-multiplatform-xlog-decode/build/compose/binaries/main-release/rpm/compose-multiplatform-xlog-decode-1.0.0-1.x86_64.rpm /home/runner/work/compose-multiplatform-xlog-decode/compose-multiplatform-xlog-decode/build/compose/binaries/main-release/rpm/compose-multiplatform-xlog-decode-linux-x86_64.rpm + mv /home/runner/work/compose-multiplatform-xlog-decode/compose-multiplatform-xlog-decode/build/compose/binaries/main-release/rpm/compose-multiplatform-xlog-decode-${{env.PACKAGE_VERSION}}-1.x86_64.rpm /home/runner/work/compose-multiplatform-xlog-decode/compose-multiplatform-xlog-decode/build/compose/binaries/main-release/rpm/compose-multiplatform-xlog-decode-${{env.V_PACKAGE_VERSION}}-linux-x86-64.rpm + mv /home/runner/work/compose-multiplatform-xlog-decode/compose-multiplatform-xlog-decode/build/compose/binaries/main-release/deb/compose-multiplatform-xlog-decode_${{env.PACKAGE_VERSION}}_amd64.deb /home/runner/work/compose-multiplatform-xlog-decode/compose-multiplatform-xlog-decode/build/compose/binaries/main-release/deb/compose-multiplatform-xlog-decode-${{env.V_PACKAGE_VERSION}}-linux-amd64.deb - if: matrix.os == 'macos-13' name: rename File run: | - mv /Users/runner/work/compose-multiplatform-xlog-decode/compose-multiplatform-xlog-decode/build/compose/binaries/main-release/dmg/compose-multiplatform-xlog-decode-1.0.0.dmg /Users/runner/work/compose-multiplatform-xlog-decode/compose-multiplatform-xlog-decode/build/compose/binaries/main-release/dmg/compose-multiplatform-xlog-decode-mac-x64.dmg + mv /Users/runner/work/compose-multiplatform-xlog-decode/compose-multiplatform-xlog-decode/build/compose/binaries/main-release/dmg/compose-multiplatform-xlog-decode-${{env.PACKAGE_VERSION}}.dmg /Users/runner/work/compose-multiplatform-xlog-decode/compose-multiplatform-xlog-decode/build/compose/binaries/main-release/dmg/compose-multiplatform-xlog-decode-${{env.V_PACKAGE_VERSION}}-macos-x86-64.dmg - if: matrix.os == 'macos-14' name: rename File run: | - mv /Users/runner/work/compose-multiplatform-xlog-decode/compose-multiplatform-xlog-decode/build/compose/binaries/main-release/dmg/compose-multiplatform-xlog-decode-1.0.0.dmg /Users/runner/work/compose-multiplatform-xlog-decode/compose-multiplatform-xlog-decode/build/compose/binaries/main-release/dmg/compose-multiplatform-xlog-decode-mac-arm64.dmg + mv /Users/runner/work/compose-multiplatform-xlog-decode/compose-multiplatform-xlog-decode/build/compose/binaries/main-release/dmg/compose-multiplatform-xlog-decode-${{env.PACKAGE_VERSION}}.dmg /Users/runner/work/compose-multiplatform-xlog-decode/compose-multiplatform-xlog-decode/build/compose/binaries/main-release/dmg/compose-multiplatform-xlog-decode-${{env.V_PACKAGE_VERSION}}-macos-arm64.dmg + + - name: get current time + id: currentTime + uses: josStorer/get-current-time@v2 + with: + format: YYYY-MM-DD - - name: create a release + - name: draft a new release uses: ncipollo/release-action@v1 with: - artifacts: "**/compose-multiplatform-xlog-decode-windows-x64.exe,**/compose-multiplatform-xlog-decode-windows-x64.zip,**/*.deb,**/*.rpm,**/*.dmg" - body: "create by workflows" + token: ${{secrets.ACTION_TOKEN}} allowUpdates: true artifactErrorsFailBuild: false generateReleaseNotes: false - tag: ${{needs.current-time.outputs.currentTime}} - name: ${{needs.current-time.outputs.currentTime}} - token: ${{secrets.ACTION_TOKEN}} \ No newline at end of file + artifacts: "**/exe/*.exe,**/app/compose-multiplatform-xlog-decode/*.zip,**/deb/*.deb,**/rpm/*.rpm,**/dmg/*.dmg" + body: "## ${{env.V_PACKAGE_VERSION}} / ${{steps.currentTime.outputs.formattedTime}}" + tag: "${{env.V_PACKAGE_VERSION}}" + name: "${{env.V_PACKAGE_VERSION}}" \ No newline at end of file diff --git a/README.md b/README.md index 8f6e698..8f4b20e 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # compose-multiplatform-xlog-decode 一个跨平台的 xlog 日志解析工具,支持 Windows、MacOS、Linux - + - [Compose Multiplatform 写一个跨平台的 xlog 解析工具](https://juejin.cn/post/7378452954221084682) ![](https://github.com/leavesCZY/compose-multiplatform-xlog-decode/assets/30774063/57187495-9dd6-4644-afb6-154c31944a40) \ No newline at end of file diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index f294362..02c2285 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -3,9 +3,9 @@ jetbrains-kotlin-plugin = "2.0.0" jetbrains-compose-plugin = "1.6.11" androidx-datastore = "1.1.1" +jetbrains-lifecycle-viewmodel-compose = "2.8.0" luben-zstd-jni = "1.5.6-3" bouncycastle-bcprov-jdk18on = "1.78.1" -jetbrains-lifecycle-viewmodel-compose = "2.8.0" [plugins] jetbrains-kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "jetbrains-kotlin-plugin" } diff --git a/src/main/kotlin/github/leavesczy/xlog/decode/LogDecodeViewModel.kt b/src/main/kotlin/github/leavesczy/xlog/decode/LogDecodeViewModel.kt index de2b0c5..53c0c77 100644 --- a/src/main/kotlin/github/leavesczy/xlog/decode/LogDecodeViewModel.kt +++ b/src/main/kotlin/github/leavesczy/xlog/decode/LogDecodeViewModel.kt @@ -116,7 +116,7 @@ class LogDecodeViewModel : ViewModel(viewModelScope = CoroutineScope(SupervisorJ outFile = outFile ) appendLog { - "解密成功,文件路径:" + outFile.absolutePath + "解析成功,文件路径:" + outFile.absolutePath } autoOpenFileIfNeed(file = outFile) outFile diff --git a/src/main/kotlin/github/leavesczy/xlog/decode/ui/MainPage.kt b/src/main/kotlin/github/leavesczy/xlog/decode/ui/MainPage.kt index 39a3f29..ea03abe 100644 --- a/src/main/kotlin/github/leavesczy/xlog/decode/ui/MainPage.kt +++ b/src/main/kotlin/github/leavesczy/xlog/decode/ui/MainPage.kt @@ -76,7 +76,7 @@ fun MainPage( val outFile = pageViewState.decodeLog() if (outFile != null) { val result = snackBarHostState.showSnackbar( - message = "解密成功,文件路径:" + outFile.absolutePath, + message = "解析成功,文件路径:" + outFile.absolutePath, actionLabel = "打开文件", withDismissAction = true, duration = SnackbarDuration.Short @@ -97,7 +97,7 @@ fun MainPage( ) { Text( modifier = Modifier, - text = "解密日志" + text = "解析日志" ) } RuntimeLog( diff --git a/src/main/kotlin/github/leavesczy/xlog/decode/ui/SettingsPage.kt b/src/main/kotlin/github/leavesczy/xlog/decode/ui/SettingsPage.kt index 3d7f3e6..e4aa7ea 100644 --- a/src/main/kotlin/github/leavesczy/xlog/decode/ui/SettingsPage.kt +++ b/src/main/kotlin/github/leavesczy/xlog/decode/ui/SettingsPage.kt @@ -2,9 +2,10 @@ package github.leavesczy.xlog.decode.ui import androidx.compose.foundation.layout.* import androidx.compose.foundation.shape.RoundedCornerShape -import androidx.compose.material.icons.Icons -import androidx.compose.material.icons.filled.Check -import androidx.compose.material3.* +import androidx.compose.material3.SegmentedButton +import androidx.compose.material3.SingleChoiceSegmentedButtonRow +import androidx.compose.material3.Switch +import androidx.compose.material3.Text import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier @@ -77,18 +78,7 @@ fun SettingsPage(pageViewState: SettingsPageViewState) { val checked = pageViewState.autOpenFileWhenParsingIsSuccessful Switch( checked = checked, - onCheckedChange = pageViewState.updateAutOpenFileWhenParsingIsSuccessful, - thumbContent = if (checked) { - { - Icon( - imageVector = Icons.Filled.Check, - contentDescription = null, - modifier = Modifier.size(SwitchDefaults.IconSize), - ) - } - } else { - null - } + onCheckedChange = pageViewState.updateAutOpenFileWhenParsingIsSuccessful ) } } diff --git a/workflows-trigger.properties b/workflows-trigger.properties index a50c2d1..2c1da59 100644 --- a/workflows-trigger.properties +++ b/workflows-trigger.properties @@ -1 +1 @@ -trigger=1 \ No newline at end of file +trigger=2 \ No newline at end of file