From 0b514f6f17386ff1db79a4e16956b717522a1f0c Mon Sep 17 00:00:00 2001 From: Zero Date: Sat, 4 Nov 2023 22:03:53 +0800 Subject: [PATCH] chore(release): bumped version to v2.0.11 --- .github/workflows/linter.yml | 18 ----------------- Dockerfile | 38 +++++++++++++++++++++++------------- version.go | 2 +- 3 files changed, 25 insertions(+), 33 deletions(-) delete mode 100644 .github/workflows/linter.yml diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml deleted file mode 100644 index a9a7f61642..0000000000 --- a/.github/workflows/linter.yml +++ /dev/null @@ -1,18 +0,0 @@ -name: Linter -on: [push, pull_request] -jobs: - lint: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - - name: Setup Go - uses: actions/setup-go@v4 - with: - check-latest: true - go-version: '1.21' - - - name: golangci-lint - uses: golangci/golangci-lint-action@v3 - with: - version: latest diff --git a/Dockerfile b/Dockerfile index f8e30f7929..42403b133a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,21 +1,31 @@ -FROM --platform=${BUILDPLATFORM} golang:alpine as builder +FROM --platform=${BUILDPLATFORM} whatwewant/builder-go:v1.21-1 as builder -RUN apk add --no-cache make git ca-certificates && \ - wget -O /Country.mmdb https://github.com/Dreamacro/maxmind-geoip/releases/latest/download/Country.mmdb -WORKDIR /workdir -COPY --from=tonistiigi/xx:golang / / -ARG TARGETOS TARGETARCH TARGETVARIANT +RUN wget -O /Country.mmdb https://github.com/doreamon-design/clash/releases/download/v2.0.8/Country.mmdb -RUN --mount=target=. \ - --mount=type=cache,target=/root/.cache/go-build \ - --mount=type=cache,target=/go/pkg/mod \ - make BINDIR= ${TARGETOS}-${TARGETARCH}${TARGETVARIANT} && \ - mv /clash* /clash +WORKDIR /build + +COPY go.mod ./ + +COPY go.sum ./ + +RUN go mod download + +COPY . . + +RUN CGO_ENABLED=0 \ + go build \ + -trimpath \ + -ldflags '-w -s -buildid=' \ + -v -o /clash ./cmd/clash + +FROM whatwewant/alpine:v3.17-1 -FROM alpine:latest LABEL org.opencontainers.image.source="https://github.com/doreamon-design/clash" COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ + COPY --from=builder /Country.mmdb /root/.config/clash/ -COPY --from=builder /clash / -ENTRYPOINT ["/clash"] + +COPY --from=builder /clash /usr/bin + +CMD clash diff --git a/version.go b/version.go index f175597376..9ced4a5752 100644 --- a/version.go +++ b/version.go @@ -1,4 +1,4 @@ package clash // Version is the version of lighthouse -var Version = "2.0.10" +var Version = "2.0.11"