Skip to content

Commit

Permalink
Merge branch 'northsea4:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
xuhao61 authored May 31, 2024
2 parents 91a9ca0 + b43a992 commit 287735d
Show file tree
Hide file tree
Showing 10 changed files with 947 additions and 498 deletions.
14 changes: 7 additions & 7 deletions .env.versions
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
# 本项目版本
PROJECT_VERSION=0.7.3
PROJECT_VERSION=0.8.0

#=== start === gui-base images ==========================

# `stainless403/gui-base`镜像版本
GUI_BASE_VERSION=0.4.0

# `stainless403/mdcx-builtin-gui-base`镜像版本
GUI_BASE_MDCX_BUILTIN_VERSION=120240220
GUI_BASE_MDCX_BUILTIN_VERSION=d20240527

# `stainless403/mdcx-src-gui-base`镜像版本
GUI_BASE_MDCX_SRC_VERSION=0.2.1
GUI_BASE_MDCX_SRC_VERSION=0.3.0

#=== end === gui-base images ==========================

Expand All @@ -21,10 +21,10 @@ GUI_BASE_MDCX_SRC_VERSION=0.2.1
WEBTOP_BASE_VERSION=0.1.2

# `stainless403/mdcx-builtin-webtop-base`镜像版本
WEBTOP_BASE_MDCX_BUILTIN_VERSION=120240220
WEBTOP_BASE_MDCX_BUILTIN_VERSION=d20240527

# `stainless403/mdcx-src-webtop-base`镜像版本
WEBTOP_BASE_MDCX_SRC_VERSION=0.2.1
WEBTOP_BASE_MDCX_SRC_VERSION=0.3.0

#=== end === webtop-base images ==========================

Expand All @@ -35,10 +35,10 @@ WEBTOP_BASE_MDCX_SRC_VERSION=0.2.1
BUILD_MDCX_BASE_VERSION=0.4.0

# `stainless403/build-mdcx`镜像版本
BUILD_MDCX_VERSION=120240220
BUILD_MDCX_VERSION=d20240527

#=== end === build-mdcx images ==========================


# MDCx最新版本
MDCX_APP_VERSION=120240220
MDCX_APP_VERSION=d20240527
60 changes: 21 additions & 39 deletions .github/workflows/watch-mdcx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,59 +58,41 @@ jobs:
run: |
source scripts/base.sh
source scripts/github.sh
source scripts/release-utils.sh
VAR_VERSION="MDCX_LATEST_VERSION"
VAR_TIME="MDCX_LATEST_TIME"
# 获取最新版本信息,返回值为数组,第一个元素为版本号,第二个元素为更新时间
getNewInfo() {
local _content=$(curl -s "${{ env.RELEASE_URL }}")
# tag名称,作为版本号
local tagName=$(printf '%s' $_content | jq -r ".tag_name")
local archiveVersion=$(echo $tagName | sed 's/v//g')
if [[ -z "$archiveVersion" || "$archiveVersion" == "null" ]]; then
echo "❌ 获取版本号失败!"
return 1
fi
# 源码压缩包(tar格式)链接
local archiveUrl=$(printf '%s' $_content | jq -r ".tarball_url")
REPO="sqzw-x/mdcx"
TAG_NAME="daily_release"
if [[ -z "$archiveUrl" ]]; then
echo "❌ 从请求结果获取源码压缩包文件下载链接失败!"
echo "🔘 请求链接:$_url"
echo "🔘 请求结果:$_content"
exit 1
fi
REPO="sqzw-x/mdcx"
TAG_NAME="daily_release"
# https://gitbook.curiouser.top/origin/linux-jq.html#%E4%B8%89%E3%80%81jq%E5%91%BD%E4%BB%A4%E5%8F%82%E6%95%B0
# -r 如果过滤的结果是一个字符串,那么直接写到标准输出(去掉字符串的引号);
local updatedAt=$(printf '%s' $_content | jq -r '.updated_at')
# 如果没有`updated_at`,则取`published_at`
if [[ -z "$updatedAt" || "$updatedAt" == "null" ]]; then
updatedAt=$(printf '%s' $_content | jq -r '.published_at')
fi
info=$(get_release_info "$REPO" "$TAG_NAME")
if [[ $? -ne 0 ]]; then
echo "❌ 获取仓库 ${REPO} 中 tag_name=${TAG_NAME} 的release信息失败!"
exit 1
else
echo "✅ 获取仓库 ${REPO} 中 tag_name=${TAG_NAME} 的release信息成功!"
fi
echo $info | jq
if [[ -z "$updatedAt" || "$updatedAt" == "null" ]]; then
echo "❌ 获取更新时间失败!"
return 1
fi
# 发布时间
published_at=$(printf '%s' $info | jq -r ".published_at")
echo "📅 发布时间: $published_at"
local info=("$archiveVersion" "$updatedAt")
echo "${info[@]}"
return 0
}
# 版本号
release_version=$(printf '%s' $info | jq -r ".release_version")
echo "🔢 版本号: $release_version"
newVersion=""
newTime=""
hasNewVersion=false
# 获取最新版本信息
info=($(getNewInfo))
newVersion=${info[0]}
newTime=${info[1]}
newVersion="$release_version"
newTime="$published_at"
# 获取已记录的版本信息
latestVersion=$(getVariable $VAR_VERSION)
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
## 更新日志

### [v0.8.0] - 2024-05-29
- 1.跟进daily_release。[#40](https://github.com/northsea4/mdcx-docker/issues/40)

### [v0.7.0] - 2023-12-24
- 1.更改上游源码项目为`sqzw-x/mdcx`#32

Expand Down
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,4 +132,8 @@ docker run -d --name mdcx \


## FAQ
请查看 [FAQ](https://github.com/northsea4/mdcx-docker/blob/main/FAQ.md)
请查看 [FAQ](https://github.com/northsea4/mdcx-docker/blob/main/FAQ.md)


## TODO
- [ ] 一键脚本github镜像加速
Loading

0 comments on commit 287735d

Please sign in to comment.