From 7ccf5651f9044d67043030e1e3aa361ea5b0955e Mon Sep 17 00:00:00 2001 From: Yasuharu Ozaki Date: Sun, 14 Nov 2021 00:23:39 +0900 Subject: [PATCH] Add build task --- .github/workflows/pr_test.yml | 5 ++++- .github/workflows/test.yml | 5 ++++- Makefile | 6 +++--- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/.github/workflows/pr_test.yml b/.github/workflows/pr_test.yml index c83a359..516f874 100644 --- a/.github/workflows/pr_test.yml +++ b/.github/workflows/pr_test.yml @@ -25,5 +25,8 @@ jobs: - name: lint run: make lint - - name: go test + - name: test run: make test + + - name: build + run: make build diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 5dbf644..db9b876 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -26,5 +26,8 @@ jobs: - name: lint run: make lint - - name: go test + - name: test run: make test + + - name: build + run: make build diff --git a/Makefile b/Makefile index 640b5c7..1f7ea5e 100644 --- a/Makefile +++ b/Makefile @@ -6,9 +6,9 @@ install: go install honnef.co/go/tools/cmd/staticcheck@2021.1.1 go mod download -.PHONY: switchbot -switchbot: pkg/switchbot/**/*.go cmd/switchbot/**/*.go go.* - go build -trimpath -ldflags "-s -w -X main.Version=${GIT_VER}" -o switchbot cmd/switchbot/main.go +.PHONY: build +build: pkg/switchbot/**/*.go cmd/switchbot/**/*.go go.* + go build -trimpath -ldflags "-s -w -X main.Version=${GIT_VER}" -o tmp/switchbot cmd/switchbot/main.go .PHONY: clean clean: