diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d3e0592..54d6789 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -18,13 +18,13 @@ jobs: fail-fast: false matrix: job: - - { os: 'ubuntu-latest', target: 'android' } - - { 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" } + - { name: 'android', os: 'ubuntu-latest', target: 'android' } + - { name: 'linux-amd64', os: 'ubuntu-20.04', target: 'linux-amd64' } + - { name: "windows-amd64", os: 'ubuntu-latest', target: 'windows-amd64', aarch: 'x64' } + - { name: "macos-universal", os: 'macos-11', target: 'macos-universal' } + - { name: "ios", 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-v1, 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'} @@ -40,6 +40,12 @@ jobs: - {name: linux-s390x, goos: linux, goarch: s390x, target: 'linux-custom', os: 'ubuntu-20.04'} runs-on: ${{ matrix.job.os }} + env: + GOOS: ${{ matrix.job.goos }} + GOARCH: ${{ matrix.job.goarch }} + GOAMD64: ${{ matrix.job.goamd64 }} + GOARM: ${{ matrix.job.goarm }} + GOMIPS: ${{ matrix.job.gomips }} steps: - name: Checkout uses: actions/checkout@v3 @@ -47,7 +53,7 @@ jobs: fetch-depth: 0 - name: Setup Go - uses: actions/setup-go@v4 + uses: actions/setup-go@v5 with: go-version-file: 'go.mod' check-latest: false @@ -80,12 +86,6 @@ 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 }} @@ -96,8 +96,7 @@ jobs: rm ./hiddify-libcore*sources* ||echo "no source" rm ./hiddify-libcore-macos-a*.dylib || echo "no macos arm and amd" files=$(ls | grep -E '^(libcore\.(dll|so|dylib|aar)|webui|Libcore.xcframework|HiddifyCli(\.exe)?)$') - filename="${{ matrix.job.target }}${{ matrix.job.goos }}${{ matrix.job.goarch }}-${{ matrix.job.goamd64 }}${{ matrix.job.goarm }}${{ matrix.job.gomips }}" - echo tar -czvf hiddify-core-${filename}.tar.gz $files + echo tar -czvf hiddify-core-${{ matrix.job.name }}.tar.gz $files tar -czvf hiddify-core-${filename}.tar.gz $files working-directory: bin diff --git a/Makefile b/Makefile index d2abb97..c60395a 100644 --- a/Makefile +++ b/Makefile @@ -55,16 +55,19 @@ windows-amd64: linux-amd64: - env GOOS=linux GOARCH=amd64 make linux-custom + env GOOS=linux GOARCH=amd64 $(GOBUILDLIB) -o $(BINDIR)/$(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 + rm -rf ./lib + chmod +x $(BINDIR)/$(CLINAME) + make webui linux-custom: - mkdir -p $(BINDIR)/lib/ - env $(GOBUILDLIB) -o $(BINDIR)/lib/$(LIBNAME).so ./custom - mkdir lib - cp $(BINDIR)/lib/$(LIBNAME).so ./lib/$(LIBNAME).so - env CGO_LDFLAGS="./lib/$(LIBNAME).so" $(GOBUILDSRV) -o $(BINDIR)/$(CLINAME) ./cli/bydll - rm -rf ./lib + mkdir -p $(BINDIR)/ + env $(GOBUILDSRV) -o $(BINDIR)/$(CLINAME) ./cli/ + #go build -trimpath -tags $(TAGS) -o $(BINDIR)/$(CLINAME) ./cli/ chmod +x $(BINDIR)/$(CLINAME) make webui