mirror of
https://github.com/juewuy/ShellCrash.git
synced 2024-11-15 19:22:54 +08:00
修改内核压缩方式
This commit is contained in:
parent
0cadd027ec
commit
6d3ec6f570
60
.github/workflows/update_meta.alpha_core.yaml
vendored
60
.github/workflows/update_meta.alpha_core.yaml
vendored
|
@ -1,60 +0,0 @@
|
|||
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/mihomo/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/mihomo/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}/mihomo-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
|
185
.github/workflows/update_meta_core_test.yaml
vendored
185
.github/workflows/update_meta_core_test.yaml
vendored
|
@ -1,185 +0,0 @@
|
|||
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:
|
||||
|
||||
- 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: Set ENV
|
||||
run: |
|
||||
sudo timedatectl set-timezone "Asia/Shanghai"
|
||||
echo "BUILDTIME=$(date)" >> $GITHUB_ENV
|
||||
shell: bash
|
||||
|
||||
- name: build core
|
||||
id: build
|
||||
run: go build -v -trimpath -ldflags "-X 'github.com/metacubex/mihomo/constant.Version=${VERSION}' -X 'github.com/metacubex/mihomo/constant.BuildTime=${BUILDTIME}' -s -w -buildid=" -tags "${TAGS}" -o meta
|
||||
|
||||
- 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 ;do #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/clash-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/clash*.tar.gz
|
||||
|
||||
- name: upload artifact
|
||||
if: ${{ env.RELEASE == '0' }}
|
||||
uses: actions/upload-artifact@v4.1.0
|
||||
with:
|
||||
name: clash-${{env.VERSION}}-${{matrix.jobs.output}}
|
||||
path: |
|
||||
./tmp/clash*.tar.gz
|
||||
compression-level: 9
|
||||
|
||||
- name: Cleanup Workflow
|
||||
uses: Mattraks/delete-workflow-runs@main
|
||||
with:
|
||||
retain_days: 1
|
||||
keep_minimum_runs: 2
|
1
.github/workflows/update_singbox_core.yaml
vendored
1
.github/workflows/update_singbox_core.yaml
vendored
|
@ -173,6 +173,7 @@ jobs:
|
|||
done
|
||||
|
||||
- name: Commit and push
|
||||
if: ${{ env.PUSHDIR != '' }}
|
||||
run: |
|
||||
[ "${{ github.event.inputs.tag1 }}" = SagerNet/sing-box ] && crashcore='singbox'
|
||||
[ "${{ github.event.inputs.tag1 }}" = PuerNya/sing-box ] && crashcore='singboxp'
|
||||
|
|
189
.github/workflows/update_singbox_core_test.yaml
vendored
189
.github/workflows/update_singbox_core_test.yaml
vendored
|
@ -1,189 +0,0 @@
|
|||
name: Test Sing-Box Core for ShellCrash
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
tag1:
|
||||
description: 'project name of sing-box, such as SagerNet/sing-box'
|
||||
required: true
|
||||
type: string
|
||||
tag2:
|
||||
description: 'tag or branches of sing-box, such as v1.7.8 or dev-next'
|
||||
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
|
||||
|
||||
sing-box:
|
||||
runs-on: ubuntu-latest
|
||||
needs: go
|
||||
env:
|
||||
REPO: ${{ github.event.inputs.tag1 }}
|
||||
TAGS: ${{ github.event.inputs.tag4 }}
|
||||
outputs:
|
||||
version: ${{steps.sing-box.outputs.version}}
|
||||
tags: ${{steps.sing-box.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 sing-box version
|
||||
id: sing-box
|
||||
run: |
|
||||
git remote add sekai https://github.com/SagerNet/sing-box.git
|
||||
git fetch --tags sekai
|
||||
version=$(CGO_ENABLED=0 go run ./cmd/internal/read_tag)
|
||||
[ -z "$version" ] && version=${{ github.event.inputs.tag2 }}
|
||||
echo version=$version >> $GITHUB_OUTPUT
|
||||
if [ -z "$TAGS" ];then
|
||||
if [ "$REPO" = 'PuerNya/sing-box' ];then
|
||||
echo tags=with_quic,with_shadowsocksr,with_ech,with_utls,with_reality_server,with_clash_api >> $GITHUB_OUTPUT
|
||||
else
|
||||
echo tags=with_quic,with_ech,with_utls,with_reality_server,with_clash_api >> $GITHUB_OUTPUT
|
||||
fi
|
||||
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: sing-box
|
||||
env:
|
||||
GOOS: ${{ matrix.goos }}
|
||||
GOARCH: ${{ matrix.goarch }}
|
||||
GOAMD64: ${{ matrix.goamd64 }}
|
||||
GOARM: ${{ matrix.goarm }}
|
||||
GOMIPS: ${{ matrix.gomips }}
|
||||
CGO_ENABLED: 0
|
||||
TAGS: ${{needs.sing-box.outputs.tags}}
|
||||
VERSION: ${{needs.sing-box.outputs.version}}
|
||||
steps:
|
||||
- name: Checkout sing-box
|
||||
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/sing-box/constant.Version=${VERSION}' -s -w -buildid=" -tags "${TAGS}" ./cmd/sing-box
|
||||
|
||||
- name: Upload file to workspace
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: ${{ matrix.name }}
|
||||
path: sing-box
|
||||
|
||||
push_prerelease:
|
||||
needs:
|
||||
- cross
|
||||
- sing-box
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
RELEASE: ${{ github.event.inputs.tag3 }}
|
||||
VERSION: ${{needs.sing-box.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}/sing-box ./tmp/CrashCore
|
||||
chmod +x ./tmp/CrashCore
|
||||
tar --no-same-owner -zcvf ./tmp/singbox-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: singbox_core${{ github.event.inputs.tag3 }}
|
||||
name: singbox_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/singbox*
|
||||
|
||||
- name: upload artifact
|
||||
if: ${{ env.RELEASE == '0' }}
|
||||
uses: actions/upload-artifact@v4.1.0
|
||||
with:
|
||||
name: sing-box-${{env.VERSION}}-${{matrix.jobs.output}}
|
||||
path: |
|
||||
./tmp/sing-box*
|
||||
compression-level: 9
|
||||
|
||||
- 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