mirror of
https://github.com/juewuy/ShellCrash.git
synced 2026-03-12 00:11:31 +00:00
~增加内核upx压缩
This commit is contained in:
20
.github/workflows/update_meta_core.yaml
vendored
20
.github/workflows/update_meta_core.yaml
vendored
@@ -120,22 +120,6 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
go-version: ${{needs.go.outputs.version}}
|
go-version: ${{needs.go.outputs.version}}
|
||||||
|
|
||||||
- name: Set variables
|
|
||||||
run: |
|
|
||||||
VERSION="${GITHUB_REF_NAME,,}-$(git rev-parse --short HEAD)"
|
|
||||||
VERSION="${VERSION//\//-}"
|
|
||||||
PackageVersion="$(curl -s "https://api.github.com/repos/MetaCubeX/mihomo/releases/latest" | jq -r '.tag_name' | sed 's/v//g' | awk -F '.' '{$NF = $NF + 1; print}' OFS='.').${VERSION/-/.}"
|
|
||||||
if [ -n "${{ github.event.inputs.version }}" ]; then
|
|
||||||
VERSION=${{ github.event.inputs.version }}
|
|
||||||
PackageVersion="${VERSION#v}"
|
|
||||||
fi
|
|
||||||
echo "VERSION=${VERSION}" >> $GITHUB_ENV
|
|
||||||
echo "PackageVersion=${PackageVersion}" >> $GITHUB_ENV
|
|
||||||
echo "BUILDTIME=$(date)" >> $GITHUB_ENV
|
|
||||||
echo "CGO_ENABLED=0" >> $GITHUB_ENV
|
|
||||||
echo "BUILDTAG=-extldflags --static" >> $GITHUB_ENV
|
|
||||||
echo "GOTOOLCHAIN=local" >> $GITHUB_ENV
|
|
||||||
|
|
||||||
- name: Update CA
|
- name: Update CA
|
||||||
run: |
|
run: |
|
||||||
sudo apt-get update && sudo apt-get install ca-certificates
|
sudo apt-get update && sudo apt-get install ca-certificates
|
||||||
@@ -145,8 +129,8 @@ jobs:
|
|||||||
- name: build core
|
- name: build core
|
||||||
id: build
|
id: build
|
||||||
run: |
|
run: |
|
||||||
go env
|
go build -v -tags "${TAGS}" -o meta -trimpath -ldflags "-extldflags --static -X 'github.com/metacubex/mihomo/constant.Version=${VERSION}' -X 'github.com/metacubex/mihomo/constant.BuildTime=$(date)' -w -s -buildid="
|
||||||
go build -v -tags "${TAGS}" -o meta -trimpath -ldflags "${BUILDTAG} -X 'github.com/metacubex/mihomo/constant.Version=${VERSION}' -X 'github.com/metacubex/mihomo/constant.BuildTime=${BUILDTIME}' -w -s -buildid="
|
|
||||||
- name: Upload file to workspace
|
- name: Upload file to workspace
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
|
|||||||
33
.github/workflows/update_singbox_core.yaml
vendored
33
.github/workflows/update_singbox_core.yaml
vendored
@@ -117,11 +117,11 @@ jobs:
|
|||||||
goos: linux
|
goos: linux
|
||||||
goarch: mips
|
goarch: mips
|
||||||
gomips: softfloat
|
gomips: softfloat
|
||||||
- name: linux-mipsel-softfloat
|
- name: linux-mipsle-softfloat
|
||||||
goos: linux
|
goos: linux
|
||||||
goarch: mipsle
|
goarch: mipsle
|
||||||
gomips: softfloat
|
gomips: softfloat
|
||||||
- name: linux-mipsel-hardfloat
|
- name: linux-mipsle-hardfloat
|
||||||
goos: linux
|
goos: linux
|
||||||
goarch: mipsle
|
goarch: mipsle
|
||||||
gomips: hardfloat
|
gomips: hardfloat
|
||||||
@@ -195,17 +195,36 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
path: ./tmp
|
path: ./tmp
|
||||||
|
|
||||||
- name: Zip core by tar
|
- name: Zip core by upx
|
||||||
|
if: endsWith(env.PUSHDIR, '_upx')
|
||||||
run: |
|
run: |
|
||||||
for arch in amd64 armv5 armv7 arm64 386 mips-softfloat mipsel-hardfloat mipsel-softfloat;do
|
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.94/upx-3.94-amd64_linux.tar.xz
|
||||||
|
tar xf upx-3.96-amd64_linux.tar.xz
|
||||||
|
tar xf upx-3.94-amd64_linux.tar.xz
|
||||||
|
for arch in amd64 armv5 armv7 arm64 386 mips-softfloat mipsle-hardfloat mipsle-softfloat;do
|
||||||
|
[ ! -f ./tmp/linux-${arch}/sing-box ] && continue
|
||||||
|
mv -f ./tmp/linux-${arch}/sing-box ./tmp/singbox-linux-${arch}.upx
|
||||||
|
chmod +x ./tmp/singbox-linux-${arch}.upx
|
||||||
|
case "${arch}" in
|
||||||
|
armv5|mips* )
|
||||||
|
./upx-3.94-amd64_linux/upx -9 --no-lzma ./tmp/singbox-linux-${arch}.upx
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
./upx-3.96-amd64_linux/upx --no-lzma ./tmp/singbox-linux-${arch}.upx
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
- name: Zip core by tar
|
||||||
|
if: ${{ !endsWith(env.PUSHDIR, '_upx') }}
|
||||||
|
run: |
|
||||||
|
for arch in amd64 armv5 armv7 arm64 386 mips-softfloat mipsle-hardfloat mipsle-softfloat;do
|
||||||
[ ! -f ./tmp/linux-${arch}/sing-box ] && continue
|
[ ! -f ./tmp/linux-${arch}/sing-box ] && continue
|
||||||
mv -f ./tmp/linux-${arch}/sing-box ./tmp/CrashCore
|
mv -f ./tmp/linux-${arch}/sing-box ./tmp/CrashCore
|
||||||
chmod +x ./tmp/CrashCore
|
chmod +x ./tmp/CrashCore
|
||||||
tar --no-same-owner -zcvf ./tmp/singbox-linux-${arch}.tar.gz -C ./tmp CrashCore
|
tar --no-same-owner -zcvf ./tmp/singbox-linux-${arch}.tar.gz -C ./tmp CrashCore
|
||||||
done
|
done
|
||||||
mv -f ./tmp/singbox-linux-mipsel-hardfloat.tar.gz ./tmp/singbox-linux-mipsle-hardfloat.tar.gz
|
|
||||||
mv -f ./tmp/singbox-linux-mipsel-softfloat.tar.gz ./tmp/singbox-linux-mipsle-softfloat.tar.gz
|
|
||||||
echo ${VERSION} > ./tmp/version
|
|
||||||
|
|
||||||
- name: Commit and push
|
- name: Commit and push
|
||||||
if: ${{ env.PUSHDIR != '' }}
|
if: ${{ env.PUSHDIR != '' }}
|
||||||
|
|||||||
Reference in New Issue
Block a user