2525 - name : Get `Go` latest version
2626 id : go
2727 run : |
28- echo "version=$(curl -sSL https://raw.githubusercontent.com/actions/go-versions/update-versions-manifest-file/versions-manifest.json | jq -r '.[0].version')" >> ${GITHUB_OUTPUT}
28+ echo "version=$(curl -sSL https://raw.githubusercontent.com/actions/go-versions/update-versions-manifest-file/versions-manifest.json | jq -r '.[0].version')" >> " ${GITHUB_OUTPUT}"
2929
3030 meta_version :
3131 runs-on : ubuntu-latest
@@ -40,19 +40,20 @@ jobs:
4040 id : version
4141 run : |
4242 while true; do
43- meta_version =$(curl -sSL https://api.github.com/repos/MetaCubeX/mihomo/releases/latest | jq -r '.tag_name' | sed 's/^v//' )
44- meta_time =$(curl -sSL https://api.github.com/repos/MetaCubeX/mihomo/releases/ latest | jq -r '.published_at // .created_at ' | xargs -I {} date -d '{} +8 hours' '+%Y-%m-%d ')
43+ latest =$(curl -sSL https://api.github.com/repos/MetaCubeX/mihomo/releases/latest)
44+ meta_version =$(echo "${ latest}" | jq -r '.tag_name ' | sed 's/^v// ')
4545 if [[ -n "${meta_version}" && "${meta_version}" != "null" ]]; then
46- echo "meta_version=${meta_version}" >> ${GITHUB_OUTPUT}
47- echo "meta_time=${meta_time}" >> ${GITHUB_OUTPUT}
46+ meta_time=$(echo "${latest}" | jq -r '.published_at // .created_at' | xargs -I {} date -d '{} +8 hours' '+%Y-%m-%d')
47+ echo "meta_version=${meta_version}" >> "${GITHUB_OUTPUT}"
48+ echo "meta_time=${meta_time}" >> "${GITHUB_OUTPUT}"
4849 break
4950 fi
5051 echo "未成功获取到 mihomo Meta 版本号,将在 10 秒后重试..."
5152 sleep 10
5253 done
5354
54- echo "meta_linux_tags=no_tailscale" >> ${GITHUB_OUTPUT}
55- echo "meta_windows_tags=with_gvisor" >> ${GITHUB_OUTPUT}
55+ echo "meta_linux_tags=no_tailscale" >> " ${GITHUB_OUTPUT}"
56+ echo "meta_windows_tags=with_gvisor" >> " ${GITHUB_OUTPUT}"
5657
5758 - name : Compare `mihomo Meta` versions with current release
5859 id : compare
6768 echo "当前 ${name} 版本较低,需要更新最新版本至 v${version}"
6869 skip_update=false
6970 fi
70- echo "skip_update=$skip_update" >> ${GITHUB_OUTPUT}
71+ echo "skip_update=$skip_update" >> " ${GITHUB_OUTPUT}"
7172
7273 meta_cross :
7374 runs-on : ubuntu-latest
@@ -150,19 +151,20 @@ jobs:
150151 id : version
151152 run : |
152153 while true; do
153- alpha_version =$(curl -sSL https://api.github.com/repos/MetaCubeX/mihomo/releases | jq -r '[.[] | select(.tag_name=="Prerelease-Alpha")][0].assets[].name' | perl -ne '/(alpha\-)([^.]+)/ && print "$1$2\n"' | head -n 1 )
154- alpha_time =$(curl -sSL https://api.github.com/repos/MetaCubeX/mihomo/ releases | jq -r '[.[] | select(.tag_name=="Prerelease-Alpha")][0] | (.updated_at // .created_at) ' | xargs -I {} date -d '{} +8 hours' '+%Y-%m-%d' )
154+ releases =$(curl -sSL https://api.github.com/repos/MetaCubeX/mihomo/releases)
155+ alpha_version =$(echo "${ releases}" | jq -r '[.[] | select(.tag_name=="Prerelease-Alpha")][0].assets[].name ' | perl -ne '/(alpha\-)([^.]+)/ && print "$1$2\n"' | head -n 1 )
155156 if [[ -n "${alpha_version}" && "${alpha_version}" != "null" ]]; then
156- echo "alpha_version=${alpha_version}" >> ${GITHUB_OUTPUT}
157- echo "alpha_time=${alpha_time}" >> ${GITHUB_OUTPUT}
157+ alpha_time=$(echo "${releases}" | jq -r '[.[] | select(.tag_name=="Prerelease-Alpha")][0] | (.updated_at // .created_at)' | xargs -I {} date -d '{} +8 hours' '+%Y-%m-%d')
158+ echo "alpha_version=${alpha_version}" >> "${GITHUB_OUTPUT}"
159+ echo "alpha_time=${alpha_time}" >> "${GITHUB_OUTPUT}"
158160 break
159161 fi
160162 echo "未成功获取到 mihomo Alpha 版本号,将在 10 秒后重试..."
161163 sleep 10
162164 done
163165
164- echo "alpha_linux_tags=no_tailscale" >> ${GITHUB_OUTPUT}
165- echo "alpha_windows_tags=with_gvisor" >> ${GITHUB_OUTPUT}
166+ echo "alpha_linux_tags=no_tailscale" >> " ${GITHUB_OUTPUT}"
167+ echo "alpha_windows_tags=with_gvisor" >> " ${GITHUB_OUTPUT}"
166168
167169 - name : Compare `mihomo Alpha` versions with current release
168170 id : compare
@@ -177,7 +179,7 @@ jobs:
177179 echo "当前 ${name} 版本较低,需要更新最新版本至 ${version}"
178180 skip_update=false
179181 fi
180- echo "skip_update=$skip_update" >> ${GITHUB_OUTPUT}
182+ echo "skip_update=$skip_update" >> " ${GITHUB_OUTPUT}"
181183
182184 alpha_cross :
183185 runs-on : ubuntu-latest
@@ -318,10 +320,10 @@ jobs:
318320 run : |
319321 if ls ./mihomo/* >/dev/null 2>&1; then
320322 echo "mihomo 文件夹内存在新内核文件,需要上传"
321- echo "mihomo_exist=true" >> ${GITHUB_OUTPUT}
323+ echo "mihomo_exist=true" >> " ${GITHUB_OUTPUT}"
322324 else
323325 echo "mihomo 文件夹内没有新内核文件,无需上传"
324- echo "mihomo_exist=false" >> ${GITHUB_OUTPUT}
326+ echo "mihomo_exist=false" >> " ${GITHUB_OUTPUT}"
325327 fi
326328
327329 - name : Release and upload `mihomo` assets
0 commit comments