💚 ci: Update .gitignore and add makefile for building the project
This commit is contained in:
parent
48efdbc7df
commit
2305da2359
4
.gitignore
vendored
4
.gitignore
vendored
@ -10,6 +10,6 @@ data
|
||||
tmp/
|
||||
/test/
|
||||
.env
|
||||
common/plugin/
|
||||
common/balancer/
|
||||
config.yaml
|
||||
config.yaml
|
||||
dist
|
18
makefile
Normal file
18
makefile
Normal file
@ -0,0 +1,18 @@
|
||||
NAME=one-api
|
||||
DISTDIR=dist
|
||||
WEBDIR=web
|
||||
VERSION=$(shell git describe --tags || echo "dev")
|
||||
GOBUILD=go build -ldflags "-s -w -X 'one-api/common.Version=$(VERSION)'"
|
||||
|
||||
all: one-api
|
||||
|
||||
web: $(WEBDIR)/build
|
||||
|
||||
$(WEBDIR)/build:
|
||||
cd $(WEBDIR) && npm install && REACT_APP_VERSION=$(VERSION) npm run build
|
||||
|
||||
one-api: web
|
||||
$(GOBUILD) -o $(DISTDIR)/$(NAME)
|
||||
|
||||
clean:
|
||||
rm -rf $(DISTDIR) && rm -rf $(WEBDIR)/build
|
Loading…
Reference in New Issue
Block a user