-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile
42 lines (28 loc) · 1.68 KB
/
makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
.PHONY: test lint build npmjs token install clean publish publish-npmjs types
DOCKER_COMPOSE_RUN_OPTIONS=--rm
ifeq (${CI},true)
DOCKER_COMPOSE_RUN_OPTIONS=--rm --user root -T
endif
PACKAGE_VERSION=$(shell cat package.json | grep -i version | sed -e "s/ //g" | cut -c 12- | sed -e "s/\",//g")
test:
@docker-compose run $(DOCKER_COMPOSE_RUN_OPTIONS) yarn test
lint:
@docker-compose run $(DOCKER_COMPOSE_RUN_OPTIONS) yarn lint
build:
@docker-compose run $(DOCKER_COMPOSE_RUN_OPTIONS) yarn build
npmjs:
@docker-compose run $(DOCKER_COMPOSE_RUN_OPTIONS) bash -c 'echo "//registry.npmjs.org/:_authToken=$$NPMJS_AUTH_TOKEN" >> .npmrc'
@docker-compose run $(DOCKER_COMPOSE_RUN_OPTIONS) bash -c 'echo "@benjaminnoufel:registry=https://registry.npmjs.org/" >> .npmrc'
token:
@docker-compose run $(DOCKER_COMPOSE_RUN_OPTIONS) bash -c 'echo "//npm.pkg.github.com/:_authToken=$$NPM_AUTH_TOKEN" >> .npmrc'
@docker-compose run $(DOCKER_COMPOSE_RUN_OPTIONS) bash -c 'echo "@benjaminnoufel:registry=https://npm.pkg.github.com/" >> .npmrc'
install:
@docker-compose run $(DOCKER_COMPOSE_RUN_OPTIONS) yarn install
clean:
@docker-compose run $(DOCKER_COMPOSE_RUN_OPTIONS) bash -c 'for file in $(shell cat .gitignore); do if [ "/.env" != "$$file" ]; then rm -rf .$$file; fi; done'
publish:
docker-compose run $(DOCKER_COMPOSE_RUN_OPTIONS) yarn publish --access public --registry https://npm.pkg.github.com/ --new-version $(PACKAGE_VERSION) --non-interactive
publish-npmjs:
docker-compose run $(DOCKER_COMPOSE_RUN_OPTIONS) yarn publish --access public --registry https://registry.npmjs.org/ --new-version $(PACKAGE_VERSION) --non-interactive
types:
docker-compose run $(DOCKER_COMPOSE_RUN_OPTIONS) yarn types