-
Notifications
You must be signed in to change notification settings - Fork 33
Expand file tree
/
Copy pathMakefile
More file actions
64 lines (55 loc) · 2.47 KB
/
Makefile
File metadata and controls
64 lines (55 loc) · 2.47 KB
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
VERSION := 3.5.2
NPM_VERSION := $(VERSION)
default:
echo "use lein directly or read the README.md file"
# Build the uberjar only (no tests, faster for development)
build:
lein do clean, uberjar
# Prepare npm package directory with JAR file
npm-prepare: build
@echo "Preparing npm package..."
mkdir -p pkg/npm/lib
cp target/uberjar/mirthsync-$(VERSION)-standalone.jar pkg/npm/lib/mirthsync.jar
@echo "Updating npm package version to $(NPM_VERSION)..."
cd pkg/npm && npm version $(NPM_VERSION) --no-git-tag-version --allow-same-version
@echo "npm package prepared in pkg/npm/"
# Build npm package tarball for local testing
npm-pack: npm-prepare
@echo "Creating npm package tarball..."
cd pkg/npm && npm pack
mv pkg/npm/*.tgz target/
@echo "Package created: target/saga-it-mirthsync-$(NPM_VERSION).tgz"
# Test npm package locally (install globally from tarball)
npm-test-install: npm-pack
@echo "Installing npm package globally for testing..."
npm install -g target/saga-it-mirthsync-$(NPM_VERSION).tgz
@echo "Testing mirthsync command..."
mirthsync -h
# Publish to npm (requires npm login)
npm-publish: npm-prepare
@echo "Publishing to npm..."
cd pkg/npm && npm publish --access public
@echo "Published @saga-it/mirthsync@$(NPM_VERSION) to npm"
# Clean npm artifacts
npm-clean:
rm -rf pkg/npm/lib/mirthsync.jar
rm -f pkg/npm/*.tgz
rm -f target/*.tgz
release:
sed -E -i.bak "s/(defproject com\\.saga-it\\/mirthsync) \"[0-9]+\\.[0-9]+\\.[0-9]+(-SNAPSHOT)?\"/\\1 \"$(VERSION)\"/g" project.clj
rm -f project.clj.bak
sed -E -i.bak "s/(version of mirthSync is) \"[0-9]+\\.[0-9]+\\.[0-9]+(-SNAPSHOT)?\"/\\1 \"$(VERSION)\"/g" README.md
rm -f README.md.bak
sed -E -i.bak "s/[0-9]+\\.[0-9]+\\.[0-9]+(-SNAPSHOT)?/$(VERSION)/g" pkg/mirthsync.sh pkg/mirthsync.bat
rm -f pkg/mirthsync.sh.bak pkg/mirthsync.bat.bak
lein do clean, test, uberjar
mkdir -p target/mirthsync-$(VERSION)/lib
cp -a pkg target/mirthsync-$(VERSION)/bin
cp target/uberjar/mirthsync-$(VERSION)-standalone.jar target/mirthsync-$(VERSION)/lib
tar -C target/ -cvzf target/mirthsync-$(VERSION).tar.gz mirthsync-$(VERSION)
cd target && zip -r mirthsync-$(VERSION).zip mirthsync-$(VERSION)
gpg --detach-sign --armor target/mirthsync-$(VERSION).tar.gz
gpg --detach-sign --armor target/mirthsync-$(VERSION).zip
cd target && sha256sum mirthsync-$(VERSION).tar.gz mirthsync-$(VERSION).zip > CHECKSUMS.txt
lein do vcs assert-committed, vcs tag
.PHONY: release default build npm-prepare npm-pack npm-test-install npm-publish npm-clean