mirror of
https://github.com/juewuy/ShellCrash.git
synced 2024-11-16 19:55:57 +08:00
Merge branch 'juewuy:dev' into dev
This commit is contained in:
commit
a321a6706d
55
.github/workflows/update_clash_core.yaml
vendored
55
.github/workflows/update_clash_core.yaml
vendored
|
@ -1,55 +0,0 @@
|
|||
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 "juewuy@gmail.com" && 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
|
184
.github/workflows/update_meta_core_test.yaml
vendored
Normal file
184
.github/workflows/update_meta_core_test.yaml
vendored
Normal file
|
@ -0,0 +1,184 @@
|
|||
name: Test meta Core for ShellCrash
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
tag1:
|
||||
description: 'project name of meta, such as MetaCubeX/mihomo'
|
||||
required: true
|
||||
type: string
|
||||
tag2:
|
||||
description: 'tag or branches of meta, such as v1.18.0 or Alpha'
|
||||
required: true
|
||||
type: string
|
||||
tag3:
|
||||
description: 'a new prerelease name or not, if value=0, then only upload-artifact'
|
||||
required: false
|
||||
type: string
|
||||
tag4:
|
||||
description: 'build tags'
|
||||
required: false
|
||||
type: string
|
||||
|
||||
jobs:
|
||||
go:
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
version: ${{steps.go.outputs.version}}
|
||||
steps:
|
||||
- name: get latest go version
|
||||
id: go
|
||||
run: |
|
||||
echo version=$(curl -s https://raw.githubusercontent.com/actions/go-versions/update-versions-manifest-file/versions-manifest.json | grep -oE '"version": "[0-9]{1}.[0-9]{1,}(.[0-9]{1,})?"' | head -1 | cut -d':' -f2 | sed 's/ //g; s/"//g') >> $GITHUB_OUTPUT
|
||||
|
||||
meta:
|
||||
runs-on: ubuntu-latest
|
||||
needs: go
|
||||
env:
|
||||
REPO: ${{ github.event.inputs.tag1 }}
|
||||
TAGS: ${{ github.event.inputs.tag4 }}
|
||||
outputs:
|
||||
version: ${{steps.meta.outputs.version}}
|
||||
tags: ${{steps.meta.outputs.tags}}
|
||||
steps:
|
||||
- uses: actions/checkout@v4.1.1
|
||||
with:
|
||||
repository: ${{ github.event.inputs.tag1 }}
|
||||
ref: ${{ github.event.inputs.tag2 }}
|
||||
fetch-depth: 0
|
||||
|
||||
- name: setup go
|
||||
uses: actions/setup-go@v4.1.0
|
||||
with:
|
||||
go-version: ${{needs.go.outputs.version}}
|
||||
|
||||
- name: get meta version
|
||||
id: meta
|
||||
run: |
|
||||
version=${{ github.event.inputs.tag2 }}
|
||||
echo version=$version >> $GITHUB_OUTPUT
|
||||
if [ -z "$TAGS" ];then
|
||||
echo tags='' >> $GITHUB_OUTPUT
|
||||
else
|
||||
echo tags=$TAGS >> $GITHUB_OUTPUT
|
||||
fi
|
||||
|
||||
cross:
|
||||
strategy:
|
||||
matrix:
|
||||
include:
|
||||
# linux
|
||||
- name: linux-amd64
|
||||
goos: linux
|
||||
goarch: amd64
|
||||
goamd64: v1
|
||||
# - name: linux-386
|
||||
# goos: linux
|
||||
# goarch: 386
|
||||
# - name: linux-arm64
|
||||
# goos: linux
|
||||
# goarch: arm64
|
||||
# - name: linux-armv5
|
||||
# goos: linux
|
||||
# goarch: arm
|
||||
# goarm: 5
|
||||
# - name: linux-armv7
|
||||
# goos: linux
|
||||
# goarch: arm
|
||||
# goarm: 7
|
||||
# - name: linux-mips-softfloat
|
||||
# goos: linux
|
||||
# goarch: mips
|
||||
# gomips: softfloat
|
||||
# - name: linux-mipsel-softfloat
|
||||
# goos: linux
|
||||
# goarch: mipsle
|
||||
# gomips: softfloat
|
||||
# - name: linux-mipsel-hardfloat
|
||||
# goos: linux
|
||||
# goarch: mipsle
|
||||
# gomips: hardfloat
|
||||
|
||||
fail-fast: false
|
||||
runs-on: ubuntu-latest
|
||||
needs: meta
|
||||
env:
|
||||
GOOS: ${{ matrix.goos }}
|
||||
GOARCH: ${{ matrix.goarch }}
|
||||
GOAMD64: ${{ matrix.goamd64 }}
|
||||
GOARM: ${{ matrix.goarm }}
|
||||
GOMIPS: ${{ matrix.gomips }}
|
||||
CGO_ENABLED: 0
|
||||
TAGS: ${{needs.meta.outputs.tags}}
|
||||
VERSION: ${{needs.meta.outputs.version}}
|
||||
steps:
|
||||
- name: Checkout meta
|
||||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
|
||||
with:
|
||||
repository: ${{ github.event.inputs.tag1 }}
|
||||
ref: ${{ github.event.inputs.tag2 }}
|
||||
fetch-depth: 1
|
||||
|
||||
- name: Setup Go
|
||||
uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: ${{ steps.go.outputs.version }}
|
||||
|
||||
- name: build core
|
||||
id: build
|
||||
run: go build -v -trimpath -ldflags "-X 'github.com/sagernet/meta/constant.Version=${VERSION}' -s -w -buildid=" -tags "${TAGS}"
|
||||
|
||||
- name: Upload file to workspace
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: ${{ matrix.name }}
|
||||
path: meta
|
||||
|
||||
push_prerelease:
|
||||
needs:
|
||||
- cross
|
||||
- meta
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
RELEASE: ${{ github.event.inputs.tag3 }}
|
||||
VERSION: ${{needs.meta.outputs.version}}
|
||||
steps:
|
||||
- name: Download file from workspace
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
path: ./tmp
|
||||
|
||||
- name: Zip core by tar
|
||||
run: |
|
||||
for arch in amd64 armv5 armv7 arm64 mips-softfloat mipsel-hardfloat mipsel-softfloat;do
|
||||
mv -f ./tmp/linux-${arch}/meta ./tmp/CrashCore
|
||||
chmod +x ./tmp/CrashCore
|
||||
tar --no-same-owner -zcvf ./tmp/meta-linux-${arch}.tar.gz -C ./tmp CrashCore
|
||||
done
|
||||
|
||||
- name: Create Release and Upload Release Asset
|
||||
if: ${{ env.RELEASE != '0' }}
|
||||
uses: softprops/action-gh-release@v1
|
||||
with:
|
||||
tag_name: meta_core${{ github.event.inputs.tag3 }}
|
||||
name: meta_core${{ github.event.inputs.tag3 }}
|
||||
body: "The ${{env.VERSION}} version of ${{ github.event.inputs.tag1 }} \n这是${{ github.event.inputs.tag1 }}的${{env.VERSION}}版本内核文件\nhttps://github.com/${{ github.event.inputs.tag1 }}/releases \nOnly support for ShellCrash\n仅适配ShellCrash项目使用"
|
||||
draft: false
|
||||
prerelease: true
|
||||
files: |
|
||||
./tmp/meta*
|
||||
|
||||
- name: upload artifact
|
||||
if: ${{ env.RELEASE == '0' }}
|
||||
uses: actions/upload-artifact@v4.1.0
|
||||
with:
|
||||
name: meta-${{env.VERSION}}-${{matrix.jobs.output}}
|
||||
path: |
|
||||
./tmp/meta*
|
||||
compression-level: 9
|
||||
|
||||
- name: Cleanup Workflow
|
||||
uses: Mattraks/delete-workflow-runs@main
|
||||
with:
|
||||
retain_days: 1
|
||||
keep_minimum_runs: 2
|
|
@ -1,53 +0,0 @@
|
|||
name: Update Premium latest Core
|
||||
on:
|
||||
#schedule:
|
||||
#- cron: 0 20 * * 6
|
||||
workflow_dispatch:
|
||||
|
||||
env:
|
||||
download_version: latest
|
||||
download_url: https://release.dreamacro.workers.dev
|
||||
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 arm64 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
|
||||
mv -f ./tmp/clash-linux-arm64 ./tmp/clash-linux-armv8
|
||||
rm -fr upx*
|
||||
- name: Create Release and Upload Release Asset
|
||||
uses: softprops/action-gh-release@v1
|
||||
with:
|
||||
tag_name: clash.premium.latest
|
||||
name: clash.premium.latest
|
||||
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项目使用"
|
||||
draft: false
|
||||
prerelease: true
|
||||
files: |
|
||||
./tmp/*
|
||||
- name: Cleanup Workflow
|
||||
uses: Mattraks/delete-workflow-runs@main
|
||||
with:
|
||||
retain_days: 1
|
||||
keep_minimum_runs: 2
|
56
.github/workflows/update_premium_core.yaml
vendored
56
.github/workflows/update_premium_core.yaml
vendored
|
@ -1,56 +0,0 @@
|
|||
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
|
||||
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 arm64 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
|
||||
mv -f ./tmp/clash-linux-arm64 ./tmp/clash-linux-armv8
|
||||
rm -fr upx*
|
||||
- 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
|
||||
- name: Cleanup Workflow
|
||||
uses: Mattraks/delete-workflow-runs@main
|
||||
with:
|
||||
retain_days: 1
|
||||
keep_minimum_runs: 2
|
Loading…
Reference in New Issue
Block a user