-
Notifications
You must be signed in to change notification settings - Fork 118
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add 'make cutarelease' to publish new versions; use "files" for small…
…er published package (#95) Also drop some unnecessary Makefile goop. The 'make cutarelease' task was copied from node-manta/Makefile with tweaks to make it work with /bin/sh that isn't ksh or bash.
- Loading branch information
Showing
6 changed files
with
43 additions
and
83 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1 @@ | ||
*.log | ||
node_modules | ||
/node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,51 +1,58 @@ | ||
# | ||
# Copyright (c) 2012, Joyent, Inc. All rights reserved. | ||
# Copyright 2019 Joyent, Inc. | ||
# | ||
# Makefile: basic Makefile for template API service | ||
# | ||
# This Makefile is a template for new repos. It contains only repo-specific | ||
# logic and uses included makefiles to supply common targets (javascriptlint, | ||
# jsstyle, restdown, etc.), which are used by other repos as well. You may well | ||
# need to rewrite most of this file, but you shouldn't need to touch the | ||
# included makefiles. | ||
# | ||
# If you find yourself adding support for new targets that could be useful for | ||
# other projects too, you should add these to the original versions of the | ||
# included Makefiles (in eng.git) so that other teams can use them too. | ||
# | ||
|
||
# | ||
# Tools | ||
# | ||
NPM_EXEC := npm | ||
TAP := ./node_modules/.bin/tap | ||
|
||
# | ||
# Files | ||
# | ||
JS_FILES := $(shell find lib -name '*.js') | ||
JSL_CONF_NODE = tools/jsl.node.conf | ||
JSL_FILES_NODE = $(JS_FILES) | ||
JSSTYLE_FILES = $(JS_FILES) | ||
JSSTYLE_FLAGS = -f tools/jsstyle.conf | ||
|
||
|
||
# This, and the includes below, provide: 'make check' and 'make clean'. | ||
include ./tools/mk/Makefile.defs | ||
include ./tools/mk/Makefile.node_deps.defs | ||
|
||
|
||
# | ||
# Repo-specific targets | ||
# | ||
.PHONY: all | ||
all: $(REPO_DEPS) | ||
$(NPM_EXEC) install | ||
npm install | ||
|
||
CLEAN_FILES += $(TAP) ./node_modules/tap | ||
CLEAN_FILES += ./node_modules | ||
|
||
.PHONY: test | ||
test: all | ||
TAP=1 $(TAP) test/*.test.js | ||
TAP=1 ./node_modules/.bin/tap test/*.test.js | ||
|
||
# Ensure CHANGES.md and package.json have the same version. | ||
.PHONY: check-version | ||
check-version: | ||
@echo version is: $(shell cat package.json | json version) | ||
[ "`cat package.json | json version`" = "`grep '^## ' CHANGES.md | head -2 | tail -1 | awk '{print $$2}'`" ] | ||
|
||
check: check-version | ||
|
||
.PHONY: cutarelease | ||
cutarelease: $(COMPLETION_FILE) check-version | ||
[ -z "`git status --short`" ] # If this fails, the working dir is dirty. | ||
@which json 2>/dev/null 1>/dev/null && \ | ||
ver=$(shell json -f package.json version) && \ | ||
name=$(shell json -f package.json name) && \ | ||
publishedVer=$(shell npm view -j $(shell json -f package.json name)@$(shell json -f package.json version) version 2>/dev/null) && \ | ||
if [ -n "$$publishedVer" ]; then \ | ||
echo "error: $$name@$$ver is already published to npm"; \ | ||
exit 1; \ | ||
fi && \ | ||
echo "** Are you sure you want to tag and publish $$name@$$ver to npm?" && \ | ||
echo "** Enter to continue, Ctrl+C to abort." && \ | ||
read | ||
ver=$(shell cat package.json | json version) && \ | ||
date=$(shell date -u "+%Y-%m-%d") && \ | ||
git tag -a "v$$ver" -m "version $$ver ($$date)" && \ | ||
git push --tags origin && \ | ||
npm publish | ||
|
||
|
||
include ./tools/mk/Makefile.deps | ||
include ./tools/mk/Makefile.node_deps.targ | ||
include ./tools/mk/Makefile.targ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.