mirror of
https://github.com/zsbai/wechat-versions.git
synced 2026-06-10 07:26:44 +00:00
Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
29c444dccc | ||
|
|
6ffdc7521d | ||
|
|
d384d045ec | ||
|
|
d10837b412 | ||
|
|
bbd7f57290 | ||
|
|
4bbb7cb04b | ||
|
|
13f522e575 | ||
|
|
c1db335770 | ||
|
|
e8471977b7 | ||
|
|
d5f9ad6ffb |
2
.github/workflows/destversion.yml
vendored
2
.github/workflows/destversion.yml
vendored
@@ -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 }}
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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])
|
||||
|
||||
|
||||
Reference in New Issue
Block a user