优化
This commit is contained in:
@@ -148,6 +148,10 @@ jobs:
|
|||||||
if-no-files-found: ignore
|
if-no-files-found: ignore
|
||||||
path: ${{ github.workspace }}/mapping/mapping.txt
|
path: ${{ github.workspace }}/mapping/mapping.txt
|
||||||
|
|
||||||
|
- name: Delete Pre-Release
|
||||||
|
if: env.type == 'release'
|
||||||
|
run: gh release delete beta -y --cleanup-tag
|
||||||
|
|
||||||
- name: Publish Pre-Release
|
- name: Publish Pre-Release
|
||||||
if: env.type == 'release'
|
if: env.type == 'release'
|
||||||
uses: ncipollo/release-action@v1
|
uses: ncipollo/release-action@v1
|
||||||
@@ -156,8 +160,6 @@ jobs:
|
|||||||
tag: "beta"
|
tag: "beta"
|
||||||
body: "此版本为测试版,可能存在不稳定情况,升级前请务必备份好数据。"
|
body: "此版本为测试版,可能存在不稳定情况,升级前请务必备份好数据。"
|
||||||
prerelease: true
|
prerelease: true
|
||||||
removeArtifacts: true
|
|
||||||
allowUpdates: true
|
|
||||||
artifacts: ${{ github.workspace }}/app/build/outputs/apk/*/*/*.apk
|
artifacts: ${{ github.workspace }}/app/build/outputs/apk/*/*/*.apk
|
||||||
|
|
||||||
lanzou:
|
lanzou:
|
||||||
|
|||||||
@@ -58,14 +58,14 @@ object AppUpdateGitHub : AppUpdate.AppUpdateInterface {
|
|||||||
}
|
}
|
||||||
val rootDoc = jsonPath.parse(body)
|
val rootDoc = jsonPath.parse(body)
|
||||||
val path = "\$.assets[?(@.name =~ /legado_${appCtx.channel}_.*?apk\$/)]"
|
val path = "\$.assets[?(@.name =~ /legado_${appCtx.channel}_.*?apk\$/)]"
|
||||||
val assetsMap = rootDoc.read<List<Any>>(path)
|
val name = rootDoc.readString("$.name")
|
||||||
.firstOrNull()
|
|
||||||
?: throw NoStackTraceException("获取新版本出错")
|
?: throw NoStackTraceException("获取新版本出错")
|
||||||
val assets = jsonPath.parse(assetsMap)
|
val tagName = name.replace("legado_${appCtx.channel}_", "")
|
||||||
val name = assets.readString("$.name")
|
|
||||||
?: throw NoStackTraceException("获取新版本出错")
|
|
||||||
val tagName = name.replace("legado_${appCtx.channel}_|\\.apk".toRegex(), "")
|
|
||||||
if (tagName > AppConst.appInfo.versionName) {
|
if (tagName > AppConst.appInfo.versionName) {
|
||||||
|
val assetsMap = rootDoc.read<List<Any>>(path)
|
||||||
|
.firstOrNull()
|
||||||
|
?: throw NoStackTraceException("获取新版本出错")
|
||||||
|
val assets = jsonPath.parse(assetsMap)
|
||||||
val updateBody = rootDoc.readString("$.body")
|
val updateBody = rootDoc.readString("$.body")
|
||||||
?: throw NoStackTraceException("获取新版本出错")
|
?: throw NoStackTraceException("获取新版本出错")
|
||||||
val downloadUrl = assets.readString("$.browser_download_url")
|
val downloadUrl = assets.readString("$.browser_download_url")
|
||||||
|
|||||||
Reference in New Issue
Block a user