diff --git a/.github/workflows/update_clash_core.yaml b/.github/workflows/update_clash_core.yaml new file mode 100644 index 0000000..a0bd4bf --- /dev/null +++ b/.github/workflows/update_clash_core.yaml @@ -0,0 +1,46 @@ +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 + env: + DEBIAN_FRONTEND: noninteractive + run: | + sudo apt-get update + sudo apt-get install -y upx-ucl + - 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 + upx ./tmp/clash-linux-${arch} + fi + done + - 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 "juewuy@gmail.com" && git config --global user.name "Bot" + git add . && git commit -m "更新Clash内核至${download_version}" || exit 0 + git push + diff --git a/.github/workflows/update_dotnet_core.yaml b/.github/workflows/update_dotnet_core.yaml new file mode 100644 index 0000000..d751ea2 --- /dev/null +++ b/.github/workflows/update_dotnet_core.yaml @@ -0,0 +1,46 @@ +name: Update DotNet Core +on: + workflow_dispatch: + inputs: + version: + description: 'version of Clash DotNet, such as v1.7.6' + required: true + type: string +env: + download_version: ${{ github.event.inputs.version }} + download_url: https://github.com/ClashDotNetFramework/experimental-clash/releases/download +jobs: + Update: + runs-on: ubuntu-latest + steps: + - name: Clone Repository + uses: actions/checkout@main + - name: Init Dependencies + env: + DEBIAN_FRONTEND: noninteractive + run: | + sudo apt-get update + sudo apt-get install -y upx-ucl + - 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 + upx ./tmp/clash-linux-${arch} + fi + done + - name: Update + run: | + rm -fr ./bin/clash.net/* + cp ./tmp/* ./bin/clash.net/ + rm -fr ./tmp + sed -i "s/clashnet_v=.*/clashnet_v=$(./bin/clash.net/clash-linux-amd64 -v 2>/dev/null | sed 's/ linux.*//;s/.* //')/" bin/version + - name: Commit and push + run: | + git config --global user.email "juewuy@gmail.com" && git config --global user.name "Bot" + git add . && git commit -m "更新DotNet内核至${download_version}" || exit 0 + git push + diff --git a/.github/workflows/update_meta_core.yaml b/.github/workflows/update_meta_core.yaml new file mode 100644 index 0000000..864226c --- /dev/null +++ b/.github/workflows/update_meta_core.yaml @@ -0,0 +1,54 @@ +name: Update Meta Core +on: + workflow_dispatch: + inputs: + tag: + description: 'tag of Clash Meta, such as Prerelease-Alpha, Prerelease-Beta, v1.11.1' + required: true + type: string +env: + download_tag: ${{ github.event.inputs.tag }} + 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 + env: + DEBIAN_FRONTEND: noninteractive + run: | + sudo apt-get update + sudo apt-get install -y upx-ucl + - 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=(amd64v1 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 + upx ./tmp/clash-linux-${new_name[i]} + fi + done + - name: Update + run: | + rm -fr ./bin/clash.meta/* + cp ./tmp/* ./bin/clash.meta/ + rm -fr ./tmp + sed -i "s/meta_v=.*/meta_v=$(./bin/clash.meta/clash-linux-amd64 -v 2>/dev/null | sed 's/ linux.*//;s/.* //')/" bin/version + - name: Commit and push + run: | + git config --global user.email "juewuy@gmail.com" && git config --global user.name "Bot" + git add . && git commit -m "更新Meta内核至${download_version}" || exit 0 + git push + diff --git a/.github/workflows/update_prenium_core.yaml b/.github/workflows/update_prenium_core.yaml new file mode 100644 index 0000000..ae223bd --- /dev/null +++ b/.github/workflows/update_prenium_core.yaml @@ -0,0 +1,46 @@ +name: Update Premium Core +on: + workflow_dispatch: + inputs: + version: + description: 'version of Clash Premium, such as 2022.05.18' + required: true + type: string +env: + download_version: ${{ github.event.inputs.version }} + download_url: https://release.dreamacro.workers.dev +jobs: + Update: + runs-on: ubuntu-latest + steps: + - name: Clone Repository + uses: actions/checkout@main + - name: Init Dependencies + env: + DEBIAN_FRONTEND: noninteractive + run: | + sudo apt-get update + sudo apt-get install -y upx-ucl + - 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 + upx ./tmp/clash-linux-${arch} + fi + done + - name: Update + run: | + rm -fr ./bin/clashpre/* + cp ./tmp/* ./bin/clashpre/ + rm -fr ./tmp + sed -i "s/clashpre_v=.*/clashpre_v=$(./bin/clashpre/clash-linux-amd64 -v 2>/dev/null | sed 's/ linux.*//;s/.* //')/" bin/version + - name: Commit and push + run: | + git config --global user.email "juewuy@gmail.com" && git config --global user.name "Bot" + git add . && git commit -m "更新Premium内核至${download_version}" || exit 0 + git push +