Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add 'make cutarelease' to publish new versions; use "files" for smaller published package #95

Merged
merged 4 commits into from
Nov 5, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
*.log
node_modules
/node_modules
6 changes: 4 additions & 2 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# node-http-signature changelog

## Not Yet Released
## not yet released

(nothing yet)

## 1.3.1

Expand Down Expand Up @@ -46,7 +48,7 @@

- First semver release.
- #36: Ensure verifySignature does not leak useful timing information
- #42: Bring the library up to the latest version of the spec (including the
- #42: Bring the library up to the latest version of the spec (including the
request-target changes)
- Support for ECDSA keys and signatures.
- Now uses `sshpk` for key parsing, validation and conversion.
Expand Down
63 changes: 35 additions & 28 deletions Makefile
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
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
"node": ">=0.10"
},
"main": "lib/index.js",
"files": [
"lib"
],
"scripts": {
"test": "tap test/*.js"
},
Expand Down
35 changes: 0 additions & 35 deletions tools/mk/Makefile.node_deps.defs

This file was deleted.

16 changes: 0 additions & 16 deletions tools/mk/Makefile.node_deps.targ

This file was deleted.