Compare commits

...

10 Commits

Author SHA1 Message Date
zsbai
29c444dccc use GHTOKEN 2022-08-24 18:56:06 +08:00
zsbai
6ffdc7521d use GHTOKEN 2022-08-24 18:54:11 +08:00
zsbai
d384d045ec use GHTOKEN 2022-08-24 18:52:42 +08:00
zsbai
d10837b412 fix 2022-08-24 18:49:25 +08:00
zsbai
bbd7f57290 rm download progress 2022-08-24 18:28:37 +08:00
zsbai
4bbb7cb04b fix bug 2022-08-24 16:41:46 +08:00
zsbai
13f522e575 Merge branch 'master' of https://github.com/zsbai/wechat-versions 2022-08-24 16:26:28 +08:00
zsbai
c1db335770 fix 2022-08-24 16:26:23 +08:00
zsbai
e8471977b7 sometimes the sha256 is different but the dest_version is the same as last version 2022-08-24 15:54:35 +08:00
zsbai
d5f9ad6ffb Update README.md 2022-08-19 23:50:50 +08:00
4 changed files with 20 additions and 13 deletions

View File

@@ -19,5 +19,5 @@ jobs:
# run: echo `date`
- name: Check new version and push
env:
GHTOKEN: ${{ secrets.GHTOKEN }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: sudo apt update && sudo apt install python3 python3-pip -y && pip install lxml requests && bash -x ./scripts/destVersionForMac.sh ${{ github.event.inputs.download_link }}

View File

@@ -1,5 +1,5 @@
# wechat-windows-versions
收集 Windows 微信版本并保存
# wechat-For-Mac-versions
收集 Mac 微信版本并保存
## 目录结构
```shell
@@ -14,7 +14,6 @@
## 说明
项目使用 Github Action 自动下载微信最新版本安装包计算 Hash 值并推送至仓库。
**注意: 3.5.0.46 版本以下(不包含 3.5.0.46 版, 仅下载了一部分)均下载自 [web.archive.org](https://web.archive.org/web/*/https://pc.weixin.qq.com/)**
各版本更新日志可参见 [changelog](https://weixin.qq.com/cgi-bin/readtemplate?lang=zh_CN&t=weixin_faq_list&head=true)

View File

@@ -49,7 +49,7 @@ function download_wechat() {
printf "#%.0s" {1..60}
echo
wget "$download_link" -O ${temp_path}/WeChatMac.dmg
wget -q "$download_link" -O ${temp_path}/WeChatMac.dmg
if [ "$?" -ne 0 ]; then
>&2 echo -e "\033[1;31mDownload Failed, please check your network!\033[0m"
clean_data 1
@@ -57,7 +57,7 @@ function download_wechat() {
}
function get_version() {
dest_version=`python scripts/getVersion.py`
dest_version=`python3 scripts/getVersion.py`
}
@@ -92,14 +92,14 @@ function clean_data() {
function main() {
# rm -rfv WeChatSetup/*
mkdir -p ${temp_path}/temp
login_gh
# login_gh
## https://github.com/actions/virtual-environments/blob/main/images/linux/Ubuntu2004-Readme.md
# install_depends
download_wechat
now_sum256=`shasum -a 256 ${temp_path}/WeChatMac.dmg | awk '{print $1}'`
local latest_sum256=`gh release view --json body --jq ".body" | awk '/Sha256/{ print $2 }'`
local latest_version=`gh release view --json body --jq ".body" | awk '/DestVersion/{ print $2 }'`
if [ "$now_sum256" = "$latest_sum256" ]; then
>&2 echo -e "\n\033[1;32mThis is the newest Version!\033[0m\n"
clean_data 0
@@ -107,10 +107,17 @@ function main() {
## if not the newest
get_version
prepare_commit
# if dest_version is the same as latest_version
if [ "$dest_version" = "$latest_version" ]; then
version="$dest_version"_`date -u '+%Y%m%d'`
echo -e $dest_version
else
version="$dest_version"
fi
gh release create v$version ./WeChatMac/$dest_version/WeChatMac-$dest_version.dmg -F ./WeChatMac/$dest_version/WeChatMac-$dest_version.dmg.sha256 -t "Wechat For Mac v$version"
gh release create v$dest_version ./WeChatMac/$dest_version/WeChatMac-$dest_version.dmg -F ./WeChatMac/$dest_version/WeChatMac-$dest_version.dmg.sha256 -t "Wechat For Mac v$dest_version"
gh auth logout --hostname github.com | echo "y"
# gh auth logout --hostname github.com | echo "y"
clean_data 0
}

View File

@@ -10,5 +10,6 @@ header = {
}
r = requests.get(url,headers=header).text
tree = lxml.etree.HTML(r)
version = tree.xpath("/html/body/div/div[2]/div/div[1]/a[1]/div/p[2]/text()")
print(version[0])
version = tree.xpath("/html/body/div/div[2]/div/div[1]/a[1]/div/p[2]/text()[1]")
print(version[0])