diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 369b904..34b8431 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -4,7 +4,7 @@ on: branches: - main tags: - - "v*" + - 'v*' paths-ignore: - '**.md' - 'docs/**' @@ -17,10 +17,10 @@ jobs: fail-fast: false matrix: job: - - { os: "ubuntu-latest", target: "android"} - - { os: "ubuntu-latest", target: "linux-amd64", aarch: 'x64'} - - { os: "ubuntu-latest", target: "windows-amd64", aarch: 'x64' } - - { os: "macos-11", target: "macos-universal" } + - { os: 'ubuntu-latest', target: 'android' } + - { os: 'ubuntu-latest', target: 'linux-amd64', aarch: 'x64' } + - { os: 'ubuntu-latest', target: 'windows-amd64', aarch: 'x64' } + - { os: 'macos-11', target: 'macos-universal' } runs-on: ${{ matrix.job.os }} steps: - name: Checkout @@ -32,7 +32,7 @@ jobs: uses: actions/setup-go@v4 with: go-version-file: 'go.mod' - check-latest: false + check-latest: false - name: Setup Java if: startsWith(matrix.job.target,'android') @@ -60,7 +60,7 @@ jobs: if: startsWith(matrix.job.target,'macos') || startsWith(matrix.job.target,'ios') run: | brew install create-dmg tree coreutils - + - name: Build run: | make -j$(($(nproc) + 1)) ${{ matrix.job.target }} @@ -98,7 +98,7 @@ jobs: uses: 8Mi-Tech/delete-release-assets-action@main with: github_token: ${{ secrets.GITHUB_TOKEN }} - tag: "draft" + tag: 'draft' deleteOnlyFromDrafts: false - name: Create or Update Draft Release @@ -108,8 +108,8 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: files: ./bin/* - name: "draft" - tag_name: "draft" + name: 'draft' + tag_name: 'draft' prerelease: true upload-release: @@ -135,4 +135,3 @@ jobs: with: tag_name: ${{ github.ref_name }} files: bin/* - diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 0000000..7f51a41 --- /dev/null +++ b/.prettierrc @@ -0,0 +1,10 @@ +{ + "overrides": [ + { + "files": ".github/**", + "options": { + "singleQuote": true + } + } + ] +} \ No newline at end of file diff --git a/Makefile b/Makefile index ee0d432..f9e7f26 100644 --- a/Makefile +++ b/Makefile @@ -3,9 +3,10 @@ BINDIR=bin BRANCH=$(shell git branch --show-current) VERSION=$(shell git describe --tags || echo "unknown version") -NAME=$(BASENAME)-$@-$(VERSION) +NAME=$(BASENAME)-$@ TAGS=with_gvisor,with_quic,with_wireguard,with_utls,with_clash_api +IOS_TAGS=with_dhcp,with_low_memory,with_conntrack GOBUILD=CGO_ENABLED=1 go build -trimpath -tags $(TAGS) -ldflags="-w -s" -buildmode=c-shared lib_install: @@ -30,11 +31,11 @@ linux-amd64: env GOOS=linux GOARCH=amd64 $(GOBUILD) -o $(BINDIR)/$(NAME).so ./custom macos-amd64: - env GOOS=darwin GOARCH=amd64 CGO_CFLAGS="-mmacosx-version-min=10.11" CGO_LDFLAGS="-mmacosx-version-min=10.11" CGO_ENABLED=1 go build -trimpath -tags $(TAGS),with_dhcp,with_low_memory,with_conntrack -buildmode=c-shared -o $(BINDIR)/$(NAME).dylib ./custom + env GOOS=darwin GOARCH=amd64 CGO_CFLAGS="-mmacosx-version-min=10.11" CGO_LDFLAGS="-mmacosx-version-min=10.11" CGO_ENABLED=1 go build -trimpath -tags $(TAGS),$(IOS_TAGS) -buildmode=c-shared -o $(BINDIR)/$(NAME).dylib ./custom macos-arm64: - env GOOS=darwin GOARCH=arm64 CGO_CFLAGS="-mmacosx-version-min=10.11" CGO_LDFLAGS="-mmacosx-version-min=10.11" CGO_ENABLED=1 go build -trimpath -tags $(TAGS),with_dhcp,with_low_memory,with_conntrack -buildmode=c-shared -o $(BINDIR)/$(NAME).dylib ./custom + env GOOS=darwin GOARCH=arm64 CGO_CFLAGS="-mmacosx-version-min=10.11" CGO_LDFLAGS="-mmacosx-version-min=10.11" CGO_ENABLED=1 go build -trimpath -tags $(TAGS),$(IOS_TAGS) -buildmode=c-shared -o $(BINDIR)/$(NAME).dylib ./custom macos-universal: macos-amd64 macos-arm64 - lipo -create $(BINDIR)/$(BASENAME)-macos-amd64-$(VERSION).dylib $(BINDIR)/$(BASENAME)-macos-arm64-$(VERSION).dylib -output $(BINDIR)/$(NAME).dylib + lipo -create $(BINDIR)/$(BASENAME)-macos-amd64.dylib $(BINDIR)/$(BASENAME)-macos-arm64.dylib -output $(BINDIR)/$(NAME).dylib clean: rm $(BINDIR)/* \ No newline at end of file