Skip to content

Commit

Permalink
major refactor to standardize
Browse files Browse the repository at this point in the history
  • Loading branch information
mosajjal committed Oct 14, 2023
1 parent 41de56d commit 020e5ea
Show file tree
Hide file tree
Showing 27 changed files with 317 additions and 760 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: Set up Go 3.x
uses: actions/setup-go@v4
with:
go-version: '^1.20'
go-version: '^1.21'

- name: Get dependencies
run: |
Expand All @@ -30,7 +30,7 @@ jobs:
fi
- name: Build
run: go build -v .
run: go build -v ./...

- name: Test
run: go test -v ./...
3 changes: 2 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ jobs:
github_token: ${{ secrets.GITHUB_TOKEN }}
goos: ${{ matrix.goos }}
goarch: ${{ matrix.goarch }}
goversion: 1.20.3
project_path: "./cmd/sniproxy"
goversion: 1.21.3
ldflags: "-s -w -X main.version=${{ github.event.release.tag_name }} -X main.commit=${{ github.sha }}"
build_flags: -v

8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM --platform=${BUILDPLATFORM:-linux/amd64} golang:1.20.6-alpine3.18
FROM --platform=${BUILDPLATFORM:-linux/amd64} golang:1.21.3-alpine3.18

ARG TARGETPLATFORM
ARG BUILDPLATFORM
Expand All @@ -9,11 +9,11 @@ LABEL maintainer "Ali Mosajjal <hi@n0p.me>"
RUN apk add --no-cache git
RUN mkdir /app
ADD . /app/
WORKDIR /app
WORKDIR /app/cmd/sniproxy
ENV CGO_ENABLED=0
RUN GOOS=${TARGETOS} GOARCH=${TARGETARCH} GOFLAGS=-buildvcs=false go build -ldflags "-s -w -X main.version=$(git describe --tags) -X main.commit=$(git rev-parse HEAD)" -o sniproxy .
CMD ["/app/sniproxy"]
CMD ["/app/cmd/sniproxy/sniproxy"]

FROM scratch
COPY --from=0 /app/sniproxy /sniproxy
COPY --from=0 /app/cmd/sniproxy/sniproxy /sniproxy
ENTRYPOINT ["/sniproxy"]
107 changes: 0 additions & 107 deletions config.defaults.yaml

This file was deleted.

153 changes: 0 additions & 153 deletions httpproxy.go

This file was deleted.

Loading

0 comments on commit 020e5ea

Please sign in to comment.