增加singbox内核生成文件
This commit is contained in:
60
.github/workflows/update_singbox_core.yaml
vendored
Normal file
60
.github/workflows/update_singbox_core.yaml
vendored
Normal file
@@ -0,0 +1,60 @@
|
||||
name: Update Sing-Box Core
|
||||
on:
|
||||
schedule:
|
||||
- cron: 0 20 * * *
|
||||
workflow_dispatch:
|
||||
|
||||
env:
|
||||
download_tag: ${{ github.event.inputs.tag }}
|
||||
download_version: ''
|
||||
download_project: SagerNet/sing-box
|
||||
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 -s -L -o /dev/null -w '%{url_effective}' https://github.com/${download_project}/releases/latest | grep -oE "[^/]+$" | awk -F 'v' '{print $2}')
|
||||
else
|
||||
download_version=${download_tag}
|
||||
fi
|
||||
echo "download_version=${download_version}" >> ${GITHUB_ENV}
|
||||
archs=(386 amd64 armv7 arm64)
|
||||
new_name=(386 amd64 armv7 armv8)
|
||||
mkdir tmp
|
||||
for i in "${new_name[@]}";do
|
||||
wget "https://github.com/${download_project}/releases/download/${download_tag}/sing-box-${download_version}-linux-${archs[i]}.tar.gz" -O - | tar -zxvf > ./tmp/singbox-linux-${new_name[i]}
|
||||
chmod +x ./tmp/singbox-linux-${new_name[i]}
|
||||
if [ "${archs[i]}" != "armv5" ];then
|
||||
if [[ ${archs[i]} = mips* ]];then
|
||||
./upx-3.93-amd64_linux/upx ./tmp/singbox-linux-${new_name[i]}
|
||||
else
|
||||
./upx-3.96-amd64_linux/upx ./tmp/singbox-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: singbox_core
|
||||
name: singbox_core
|
||||
body: "The alpha version of singbox core \n这是singbox的官方版本内核文件\nhttps://github.com/${download_project}/releases \nZip by upx\n使用了upx进行压缩\nOnly support for ShellCrash\n仅限于ShellCrash项目使用"
|
||||
draft: false
|
||||
prerelease: true
|
||||
files: |
|
||||
./tmp/*
|
||||
- name: Cleanup Workflow
|
||||
uses: Mattraks/delete-workflow-runs@main
|
||||
with:
|
||||
retain_days: 1
|
||||
keep_minimum_runs: 2
|
||||
Reference in New Issue
Block a user