|
| 1 | +name: Update Premium latest Core |
| 2 | +on: |
| 3 | + schedule: |
| 4 | + - cron: "0 20 * * 1,3,5,6" |
| 5 | + workflow_dispatch: |
| 6 | + |
| 7 | +env: |
| 8 | + download_version: latest |
| 9 | + download_url: https://release.dreamacro.workers.dev |
| 10 | +jobs: |
| 11 | + Update: |
| 12 | + runs-on: ubuntu-latest |
| 13 | + steps: |
| 14 | + - name: Clone Repository |
| 15 | + uses: actions/checkout@main |
| 16 | + - name: Init Dependencies |
| 17 | + run: | |
| 18 | + wget https://github.com/upx/upx/releases/download/v3.96/upx-3.96-amd64_linux.tar.xz |
| 19 | + wget https://github.com/upx/upx/releases/download/v3.93/upx-3.93-amd64_linux.tar.xz |
| 20 | + tar xf upx-3.96-amd64_linux.tar.xz |
| 21 | + tar xf upx-3.93-amd64_linux.tar.xz |
| 22 | + - name: Download Core |
| 23 | + run: | |
| 24 | + archs="386 amd64 armv5 armv7 arm64 mips-softfloat mipsle-hardfloat mipsle-softfloat" |
| 25 | + mkdir tmp |
| 26 | + for arch in ${archs};do |
| 27 | + wget "${download_url}/${download_version}/clash-linux-${arch}-${download_version}.gz" -O - | gunzip -c > ./tmp/clash-linux-${arch} |
| 28 | + chmod +x ./tmp/clash-linux-${arch} |
| 29 | + if [ "${arch}" != "armv5" ];then |
| 30 | + if [[ ${arch} == mips* ]];then |
| 31 | + ./upx-3.93-amd64_linux/upx ./tmp/clash-linux-${arch} |
| 32 | + else |
| 33 | + ./upx-3.96-amd64_linux/upx ./tmp/clash-linux-${arch} |
| 34 | + fi |
| 35 | + fi |
| 36 | + done |
| 37 | + mv -f ./tmp/clash-linux-arm64 ./tmp/clash-linux-armv8 |
| 38 | + rm -fr upx* |
| 39 | + - name: Create Release and Upload Release Asset |
| 40 | + uses: softprops/action-gh-release@v1 |
| 41 | + with: |
| 42 | + tag_name: clash.premium.latest |
| 43 | + name: clash.premium.latest |
| 44 | + body: "The latest version of clash.premium core \n这是clash.premium的最新版本内核文件\nhttps://github.com/Dreamacro/clash/releases/tag/premium \nZip by upx\n使用了upx进行压缩\nOnly support for ShellClash\n仅限于ShellClash项目使用" |
| 45 | + draft: false |
| 46 | + prerelease: true |
| 47 | + files: | |
| 48 | + ./tmp/* |
| 49 | + |
0 commit comments