Skip to content

Commit

Permalink
0
Browse files Browse the repository at this point in the history
  • Loading branch information
2375399351 committed Nov 3, 2023
1 parent 7ff6538 commit f7746d7
Show file tree
Hide file tree
Showing 88 changed files with 52,131 additions and 1 deletion.
32 changes: 32 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Feature report
description: Suggest an idea for this project
title: "[Feature] "
body:
- type: checkboxes
id: ensure
attributes:
label: Verify steps
description: "
在提交之前,请确认
Please verify that you've followed these steps
"
options:
- label: "
我已经在 [Issue Tracker](……/) 中找过我要提出的问题
I have searched on the [issue tracker](……/) for a related issue.
"
required: true
- label: "
我已经使用公测版本测试过,问题依旧存在
I have tested using the test mod, and the issue still exists.
"
required: true
- label: "
我已经仔细看过 [常见问题](https://juewuy.github.io/chang-jian-wen-ti/) 并无法自行解决问题
"
required: true
- type: textarea
attributes:
label: Description
validations:
required: true
33 changes: 33 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Bug report
description: Create a report to help us improve
title: "[Bug] "
body:
- type: checkboxes
id: ensure
attributes:
label: Verify steps
description: "
在提交之前,请确认
Please verify that you've followed these steps
"
options:
- label: "
我已经在 [Issue Tracker](……/) 中找过我要提出的问题
I have searched on the [issue tracker](……/) for a related issue.
"
required: true
- label: "
我已经使用公测版本测试过,问题依旧存在
I have tested using the test mod, and the issue still exists.
"
required: true
- label: "
我已经仔细看过 [常见问题](https://juewuy.github.io/chang-jian-wen-ti/) 并无法自行解决问题
"
required: true
- type: textarea
attributes:
label: Description
description: 请详细、清晰地表达你要提出的论述,例如这个问题如何影响到你?你想实现什么功能?目前ShellClash的行为是什么?
validations:
required: true
123 changes: 123 additions & 0 deletions .github/workflows/bin_update.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
name: bin_update

on:
# release:
# types: [published]
# push:
# tags:
# - 'v*'
# branches:
# - master
schedule:
- cron: 0 18 * * 6
# watch:
# types: [started]
workflow_dispatch:

jobs:
update:
runs-on: ubuntu-latest

steps:

- name: Checkout
uses: actions/checkout@master

- name: Apt Update
env:
DEBIAN_FRONTEND: noninteractive
run: |
sudo apt-get update
sudo apt-get -y install unzip curl git tar
- name: Update Dashboard
run: |
mkdir -p bin/dashboard
mkdir -p bin/geodata
cd bin/dashboard
echo 下载官方面板
curl -kfSL -o clashdb.zip https://github.com/Dreamacro/clash-dashboard/archive/gh-pages.zip
echo 下载Meta面板
curl -kfSL -o meta_db.zip https://github.com/MetaCubeX/Razord-meta/archive/gh-pages.zip
echo 下载yacd面板
curl -kfSL -o yacd.zip https://github.com/haishanh/yacd/archive/gh-pages.zip
echo 下载meta魔改yacd面板
curl -kfSL -o meta_yacd.zip https://github.com/MetaCubeX/Yacd-meta/archive/gh-pages.zip
echo 下载meta-xd面板
curl -kfSL -o meta_xd.zip https://github.com/MetaCubeX/metacubexd/archive/gh-pages.zip
echo 解压缩
unzip -o clashdb.zip > /dev/null
unzip -o yacd.zip > /dev/null
cd clash-dashboard-gh-pages
tar -zcvf clashdb.tar.gz * > /dev/null
mv -f clashdb.tar.gz ../
cd ..
cd yacd-gh-pages
echo yacd特殊处理
find -name '*.map' | xargs rm -rf
rm -rf report.html
tar -zcvf yacd.tar.gz * > /dev/null
mv -f yacd.tar.gz ../
cd ..
echo 解压缩meta
unzip -o meta_db.zip > /dev/null
unzip -o meta_yacd.zip > /dev/null
cd Razord-meta-gh-pages
tar -zcvf meta_db.tar.gz * > /dev/null
mv -f meta_db.tar.gz ../
cd ..
cd Yacd-meta-gh-pages
echo yacd特殊处理
find -name '*.map' | xargs rm -rf
rm -rf report.html
tar -zcvf meta_yacd.tar.gz * > /dev/null
mv -f meta_yacd.tar.gz ../
cd ..
echo 解压缩meta-xd
unzip -o meta_xd.zip > /dev/null
cd metacubexd-gh-pages
echo 删除字体文件
find -name '*.ttf' | xargs rm -rf
tar -zcvf meta_xd.tar.gz * > /dev/null
mv -f meta_xd.tar.gz ../
cd ..
rm -rf clashdb.zip
rm -rf yacd.zip
rm -rf meta_db.zip
rm -rf meta_yacd.zip
rm -rf meta_xd.zip
rm -rf clash-dashboard-gh-pages
rm -rf yacd-gh-pages
rm -rf Razord-meta-gh-pages
rm -rf Yacd-meta-gh-pages
rm -rf metacubexd-gh-pages
echo 面板更新完成!
- name: Update GeoIP
run: |
cd bin
source version
curl -kfSL -o geodata/Country.mmdb https://raw.githubusercontent.com/alecthw/mmdb_china_ip_list/release/Country.mmdb
curl -kfSL -o geodata/cn_mini.mmdb https://raw.githubusercontent.com/Hackl0us/GeoIP2-CN/release/Country.mmdb
curl -kfSL -o geodata/china_ip_list.txt https://raw.githubusercontent.com/17mon/china_ip_list/master/china_ip_list.txt
curl -kfSL -o geodata/china_ipv6_list.txt https://raw.githubusercontent.com/ChanthMiao/China-IPv6-List/release/cn6.txt
curl -kfSL -o geodata/geosite.dat https://raw.githubusercontent.com/Loyalsoldier/v2ray-rules-dat/release/geosite.dat
curl -kfSL -o fix/ca-certificates.crt https://raw.githubusercontent.com/P3TERX/ca-certificates.crt/download/ca-certificates.crt
sed -i '/GeoIP_v*/'d version
echo GeoIP_v=`date '+%Y%m%d'` >> version
echo 数据库及根证书文件更新完成!
- name: Commit and push
run: |
git config --global user.email "[email protected]" && git config --global user.name "Bot"
git add . && git commit -m "自动更新最新Dashboard、地址库、根证书" || exit 0
git push
- name: Cleanup Workflow
uses: Mattraks/delete-workflow-runs@main
with:
retain_days: 1
keep_minimum_runs: 2
74 changes: 74 additions & 0 deletions .github/workflows/release_new_version.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: Release New Version
on:
workflow_dispatch:
inputs:
release_version:
description: 'new version of ShellClash, such as 1.7.0f'
required: true
type: string
release_type:
required: true
type: choice
options:
- '内测版'
- '公测版'
- '正式版'
env:
new_version: ${{ github.event.inputs.release_version }}
new_type: ${{ github.event.inputs.release_type }}
jobs:
Update:
runs-on: ubuntu-latest
steps:
- name: Clone Repository
uses: actions/checkout@main
- name: Update Version Number
if: ${{ github.event.inputs.release_type != '内测版' }}
run: |
if [[ "${new_type}" == "正式版" ]]; then
sed -i "1i ${new_version}" ./bin/release_version
elif [[ "${new_type}" == "公测版" ]]; then
sed -i "s/versionsh=.*/versionsh=${new_version}/" ./bin/version
sed -i "s/version=.*/version=${new_version}/" ./scripts/init.sh
fi
- name: Package
if: ${{ github.event.inputs.release_type != '正式版' }}
run: |
cd ./bin
# 打包 clashfm.tar.gz
rm ./clashfm.tar.gz
mkdir clashfm && pushd clashfm
cp ../../scripts/* ./
chmod +x *
tar zcvf ../clashfm.tar.gz *
popd && rm -fr clashfm
# 打包 ShellClash.tar.gz
rm ./ShellClash.tar.gz
mkdir ShellClash && pushd ShellClash
cp ../../scripts/* ./
chmod +x *
cp ../Country.mmdb ./
tar zcvf ../ShellClash.tar.gz *
popd && rm -fr ./ShellClash
- name: Commit and push
if: ${{ github.event.inputs.release_type != '内测版' }}
run: |
git config --global user.email "[email protected]" && git config --global user.name "Bot"
git add . && git commit -m "${new_type} ${new_version} 打包" || exit 0
git push
if [[ "${new_type}" == "正式版" ]]; then
git tag ${new_version}
git push origin ${new_version}
fi
- name: Package Artifact
id: package_artifact
run: |
mkdir artifacts
cp ./bin/clashfm.tar.gz ./artifacts/
cp ./bin/ShellClash.tar.gz ./artifacts/
echo "artifact_name=${new_type}_${new_version}_$(date +%Y%m%d%H%M%S)" >> $GITHUB_OUTPUT
- name: Upload Test Artifact
uses: actions/upload-artifact@main
with:
name: ${{ steps.package_artifact.outputs.artifact_name }}
path: ./artifacts/*
55 changes: 55 additions & 0 deletions .github/workflows/update_clash_core.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Update Clash Core
on:
workflow_dispatch:
inputs:
version:
description: 'version of Clash, such as v1.10.6'
required: true
type: string
env:
download_version: ${{ github.event.inputs.version }}
download_url: https://github.com/Dreamacro/clash/releases/download
jobs:
Update:
runs-on: ubuntu-latest
steps:
- name: Clone Repository
uses: actions/checkout@main
- name: Init Dependencies
run: |
wget https://github.com/upx/upx/releases/download/v3.96/upx-3.96-amd64_linux.tar.xz
wget https://github.com/upx/upx/releases/download/v3.93/upx-3.93-amd64_linux.tar.xz
tar xf upx-3.96-amd64_linux.tar.xz
tar xf upx-3.93-amd64_linux.tar.xz
- name: Download Core
run: |
archs="386 amd64 armv5 armv7 armv8 mips-softfloat mipsle-hardfloat mipsle-softfloat"
mkdir tmp
for arch in ${archs};do
wget "${download_url}/${download_version}/clash-linux-${arch}-${download_version}.gz" -O - | gunzip -c > ./tmp/clash-linux-${arch}
chmod +x ./tmp/clash-linux-${arch}
if [ "${arch}" != "armv5" ];then
if [[ ${arch} == mips* ]];then
./upx-3.93-amd64_linux/upx ./tmp/clash-linux-${arch}
else
./upx-3.96-amd64_linux/upx ./tmp/clash-linux-${arch}
fi
fi
done
rm -fr upx*
- name: Update
run: |
rm -fr ./bin/clash/*
cp ./tmp/* ./bin/clash/
rm -fr ./tmp
sed -i "s/clash_v=.*/clash_v=$(./bin/clash/clash-linux-amd64 -v 2>/dev/null | sed 's/ linux.*//;s/.* //')/" bin/version
- name: Commit and push
run: |
git config --global user.email "[email protected]" && git config --global user.name "Bot"
git add . && git commit -m "更新Clash内核至${download_version}" || exit 0
git push
- name: Cleanup Workflow
uses: Mattraks/delete-workflow-runs@main
with:
retain_days: 1
keep_minimum_runs: 2
60 changes: 60 additions & 0 deletions .github/workflows/update_meta.alpha_core.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Update Meta Alpha Core
on:
schedule:
- cron: 0 20 * * *
workflow_dispatch:

env:
download_tag: Prerelease-Alpha
download_version: ''
download_url: https://github.com/MetaCubeX/Clash.Meta/releases/download
jobs:
Update:
runs-on: ubuntu-latest
steps:
- name: Clone Repository
uses: actions/checkout@main
- name: Init Dependencies
run: |
wget https://github.com/upx/upx/releases/download/v3.96/upx-3.96-amd64_linux.tar.xz
wget https://github.com/upx/upx/releases/download/v3.93/upx-3.93-amd64_linux.tar.xz
tar xf upx-3.96-amd64_linux.tar.xz
tar xf upx-3.93-amd64_linux.tar.xz
- name: Download Core
run: |
if [ "${download_tag}" = "Prerelease-Alpha" ] || [ "${download_tag}" = "Prerelease-Beta" ];then
download_version=$(curl -sL https://api.github.com/repos/MetaCubeX/Clash.Meta/releases/tags/${download_tag} | grep linux-arm64 | head -n 1 | sed 's_.gz.*__;s_.*arm64-__')
else
download_version=${download_tag}
fi
echo "download_version=${download_version}" >> ${GITHUB_ENV}
archs=(amd64-compatible armv5 armv7 arm64 mips-softfloat mipsle-hardfloat mipsle-softfloat)
new_name=(amd64 armv5 armv7 armv8 mips-softfloat mipsle-hardfloat mipsle-softfloat)
mkdir tmp
for((i=0;i<7;i++));do
wget "${download_url}/${download_tag}/Clash.Meta-linux-${archs[i]}-${download_version}.gz" -O - | gunzip -c > ./tmp/clash-linux-${new_name[i]}
chmod +x ./tmp/clash-linux-${new_name[i]}
if [ "${archs[i]}" != "armv5" ];then
if [[ ${archs[i]} = mips* ]];then
./upx-3.93-amd64_linux/upx ./tmp/clash-linux-${new_name[i]}
else
./upx-3.96-amd64_linux/upx ./tmp/clash-linux-${new_name[i]}
fi
fi
done
rm -fr upx*
- name: Create Release and Upload Release Asset
uses: softprops/action-gh-release@v1
with:
tag_name: clash.meta.alpha
name: clash.meta.alpha
body: "The alpha version of clash.meta core \n这是clash.meta的Alpha版本内核文件\nhttps://github.com/MetaCubeX/Clash.Meta/releases/tag/Prerelease-Alpha \nZip by upx\n使用了upx进行压缩\nOnly support for ShellClash\n仅限于ShellClash项目使用"
draft: false
prerelease: true
files: |
./tmp/*
- name: Cleanup Workflow
uses: Mattraks/delete-workflow-runs@main
with:
retain_days: 1
keep_minimum_runs: 2
Loading

0 comments on commit f7746d7

Please sign in to comment.