mirror of https://github.com/0xERR0R/blocky.git
generate outside of docker
This commit is contained in:
parent
0136755f4a
commit
9cbff3d180
|
@ -58,6 +58,15 @@ jobs:
|
|||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Set up Go
|
||||
uses: actions/setup-go@v3
|
||||
with:
|
||||
go-version-file: go.mod
|
||||
|
||||
- name: Go Generate
|
||||
shell: bash
|
||||
run: go generate ./...
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v2
|
||||
|
|
|
@ -36,15 +36,13 @@ RUN --mount=type=cache,target=/root/go/pkg,sharing=locked \
|
|||
|
||||
# add source
|
||||
ADD . .
|
||||
RUN go generate ./...
|
||||
|
||||
# setup environment
|
||||
ENV GO111MODULE=on
|
||||
ENV CGO_ENABLED=0
|
||||
|
||||
# build binary
|
||||
RUN --mount=type=cache,target=/root/.cache/go-build,sharing=locked \
|
||||
go build \
|
||||
RUN go build \
|
||||
-tags static \
|
||||
-v \
|
||||
-ldflags="-linkmode external -extldflags -static -X github.com/0xERR0R/blocky/util.Version=${VERSION} -X github.com/0xERR0R/blocky/util.BuildTime=${BUILD_TIME}" \
|
||||
|
|
1
Makefile
1
Makefile
|
@ -49,6 +49,7 @@ fmt: ## gofmt and goimports all go files
|
|||
find . -name '*.go' | while read -r file; do gofmt -w -s "$$file"; goimports -w "$$file"; done
|
||||
|
||||
docker-build: ## Build docker image
|
||||
go generate ./...
|
||||
docker buildx build -o type=docker --build-arg VERSION=${VERSION} --build-arg BUILD_TIME=${BUILD_TIME} --network=host -t ${DOCKER_IMAGE_NAME} .
|
||||
|
||||
help: ## Shows help
|
||||
|
|
Loading…
Reference in New Issue