From a2f9d0e2555e6affe696b8e6f56ef29e5087ee84 Mon Sep 17 00:00:00 2001 From: Hiddify Date: Sat, 9 Mar 2024 23:04:11 +0100 Subject: [PATCH] new: add all linux support --- .github/workflows/release.yml | 25 +++++++++++++++++++++++-- Makefile | 11 ++++++++--- 2 files changed, 31 insertions(+), 5 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c4ae3f4..0abcdb4 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -19,11 +19,26 @@ jobs: matrix: job: - { os: 'ubuntu-latest', target: 'android' } - - { os: 'ubuntu-20.04', target: 'linux-amd64', aarch: 'x64' } + - { os: 'ubuntu-20.04', target: 'linux-amd64' } - { os: 'ubuntu-latest', target: 'windows-amd64', aarch: 'x64' } - { os: 'macos-11', target: 'macos-universal' } - { os: "macos-11", target: "ios" } - + # linux custom + - {name: linux-amd64, goos: linux, goarch: amd64, goamd64: v1, target: 'linux-custom', os: 'ubuntu-20.04'} + - {name: linux-amd64-v3, goos: linux, goarch: amd64, goamd64: v3, target: 'linux-custom', os: 'ubuntu-20.04'} + - {name: linux-386, goos: linux, goarch: 386, target: 'linux-custom', os: 'ubuntu-20.04'} + - {name: linux-arm64, goos: linux, goarch: arm64, target: 'linux-custom', os: 'ubuntu-20.04'} + - {name: linux-armv5, goos: linux, goarch: arm, goarm: 5, target: 'linux-custom', os: 'ubuntu-20.04'} + - {name: linux-armv6, goos: linux, goarch: arm, goarm: 6, target: 'linux-custom', os: 'ubuntu-20.04'} + - {name: linux-armv7, goos: linux, goarch: arm, goarm: 7, target: 'linux-custom', os: 'ubuntu-20.04'} + - {name: linux-mips-softfloat, goos: linux, goarch: mips, gomips: softfloat, target: 'linux-custom', os: 'ubuntu-20.04'} + - {name: linux-mips-hardfloat, goos: linux, goarch: mips, gomips: hardfloat, target: 'linux-custom', os: 'ubuntu-20.04'} + - {name: linux-mipsel-softfloat, goos: linux, goarch: mipsle, gomips: softfloat, target: 'linux-custom', os: 'ubuntu-20.04'} + - {name: linux-mipsel-hardfloat, goos: linux, goarch: mipsle, gomips: hardfloat, target: 'linux-custom', os: 'ubuntu-20.04'} + - {name: linux-mips64, goos: linux, goarch: mips64, target: 'linux-custom', os: 'ubuntu-20.04'} + - {name: linux-mips64el, goos: linux, goarch: mips64le, target: 'linux-custom', os: 'ubuntu-20.04'} + - {name: linux-s390x, goos: linux, goarch: s390x, target: 'linux-custom', os: 'ubuntu-20.04'} + runs-on: ${{ matrix.job.os }} steps: - name: Checkout @@ -65,6 +80,12 @@ jobs: brew install create-dmg tree coreutils - name: Build + env: + GOOS: ${{ matrix.job.goos }} + GOARCH: ${{ matrix.job.goarch }} + GOAMD64: ${{ matrix.job.goamd64 }} + GOARM: ${{ matrix.job.goarm }} + GOMIPS: ${{ matrix.job.gomips }} run: | make -j$(($(nproc) + 1)) ${{ matrix.job.target }} diff --git a/Makefile b/Makefile index 10ac101..d2abb97 100644 --- a/Makefile +++ b/Makefile @@ -55,10 +55,15 @@ windows-amd64: linux-amd64: - env GOOS=linux GOARCH=amd64 $(GOBUILDLIB) -o $(BINDIR)/$(LIBNAME).so ./custom + env GOOS=linux GOARCH=amd64 make linux-custom + + +linux-custom: + mkdir -p $(BINDIR)/lib/ + env $(GOBUILDLIB) -o $(BINDIR)/lib/$(LIBNAME).so ./custom mkdir lib - cp $(BINDIR)/$(LIBNAME).so ./lib/$(LIBNAME).so - env GOOS=linux GOARCH=amd64 CGO_LDFLAGS="./lib/$(LIBNAME).so" $(GOBUILDSRV) -o $(BINDIR)/$(CLINAME) ./cli/bydll + cp $(BINDIR)/lib/$(LIBNAME).so ./lib/$(LIBNAME).so + env CGO_LDFLAGS="./lib/$(LIBNAME).so" $(GOBUILDSRV) -o $(BINDIR)/$(CLINAME) ./cli/bydll rm -rf ./lib chmod +x $(BINDIR)/$(CLINAME) make webui