Skip to content

Commit

Permalink
Updated Makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
trezorg committed Feb 10, 2022
1 parent b1e4d51 commit 2b1a869
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
upload_url: ${{ steps.release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: ./lingualeo
asset_name: lingualeo
asset_content_type: application/octet-stream
Expand Down
12 changes: 9 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@
PWD := $(shell pwd)
BASE_DIR := $(shell basename $(PWD))
# Keep an existing GOPATH, make a private one if it is undefined
GOPATH_DEFAULT := $(PWD)/.go
GOPATH_DEFAULT := $(shell go env GOPATH)/.go
OLD_PATH := ${PATH}
export GOPATH ?= $(GOPATH_DEFAULT)
GOBIN_DEFAULT := $(GOPATH)/bin
export GOBIN ?= $(GOBIN_DEFAULT)
export GO111MODULE := on
export PATH=${OLD_PATH}:${GOBIN}
TESTARGS_DEFAULT := -v -race
TESTARGS ?= $(TESTARGS_DEFAULT)
PKG := $(shell awk '/^module/ { print $$2 }' go.mod)
Expand Down Expand Up @@ -38,12 +40,15 @@ $(GOBIN):

work: $(GOBIN)

build: clean check test
build: clean cache check test
CGO_ENABLED=0 GOOS=$(GOOS) GOARCH=$(GOARCH) go build \
-ldflags $(LDFLAGS) \
-o $(BINARY) \
$(CMD_PACKAGE)

cache:
go clean --cache

install: clean check test
CGO_ENABLED=0 GOOS=$(GOOS) GOARCH=$(GOARCH) go install \
-ldflags $(LDFLAGS) \
Expand All @@ -63,7 +68,8 @@ ifndef HAS_GOIMPORTS
echo "installing goimports"
GO111MODULE=off go get golang.org/x/tools/cmd/goimports
endif
goimports -d $(shell find . -iname "*.go")
goimports -d $(shell find . -path ./.go -prune -o -type f -iname "*.go")
find . -iname "*.go"

vet:
go vet ./...
Expand Down

0 comments on commit 2b1a869

Please sign in to comment.