Skip to content

Commit 280fc84

Browse files
authored
Improve packaging routines and checks (#32)
Signed-off-by: Juan Cruz Viotti <[email protected]>
1 parent 713e20b commit 280fc84

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,4 @@ jobs:
2121
- uses: actions/checkout@v4
2222
- run: make lint
2323
- run: make test
24+
- run: make dist

Makefile

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ SHELLCHECK ?= shellcheck
33
PYTHON ?= python3
44
CURL ?= curl
55
BSDTAR ?= bsdtar
6+
TAR ?= tar
7+
ZIP ?= zip
8+
UNZIP ?= unzip
9+
GZIP ?= gzip
610
MKDIRP ?= mkdir -p
711
RMRF ?= rm -rf
812

@@ -12,6 +16,7 @@ TESTS = $(shell find test/ -type f -name '*.json')
1216

1317
VERSION = $(shell tr -d '\n\r' < VERSION)
1418

19+
# TODO: Make `jsonschema fmt` automatically detect test files
1520
all: common test
1621
$(JSONSCHEMA) fmt schemas meta --verbose
1722
$(JSONSCHEMA) fmt test --verbose --default-dialect "https://json-schema.org/draft/2020-12/schema"
@@ -25,6 +30,7 @@ common:
2530
$(SHELLCHECK) scripts/*.sh
2631
./scripts/schemas-tests-mirror.sh
2732

33+
# TODO: Make `jsonschema fmt` automatically detect test files
2834
.PHONY: lint
2935
lint: common
3036
$(JSONSCHEMA) fmt schemas meta --verbose --check
@@ -41,9 +47,15 @@ include generate/iso/country/include.mk
4147
external: $(EXTERNAL)
4248
generate: $(GENERATE)
4349

50+
# TODO: Add a `jsonschema pkg` command instead
4451
.PHONY: dist
4552
dist:
4653
$(RMRF) $@
4754
$(MKDIRP) $@
48-
$(BSDTAR) -caf $@/sourcemeta-std-v$(VERSION).zip -s '|^schemas/||' --exclude '.DS_Store' schemas/* LICENSE
49-
$(BSDTAR) -czf $@/sourcemeta-std-v$(VERSION).tar.gz -s '|^schemas/||' --exclude '.DS_Store' schemas/* LICENSE
55+
cd schemas && $(ZIP) -r ../$@/sourcemeta-std-v$(VERSION).zip * -x '*.DS_Store'
56+
$(ZIP) $@/sourcemeta-std-v$(VERSION).zip LICENSE
57+
$(UNZIP) -l $@/sourcemeta-std-v$(VERSION).zip
58+
cd schemas && $(TAR) -cf ../$@/sourcemeta-std-v$(VERSION).tar --exclude '.DS_Store' *
59+
$(TAR) -rf $@/sourcemeta-std-v$(VERSION).tar LICENSE
60+
$(GZIP) $@/sourcemeta-std-v$(VERSION).tar
61+
$(TAR) -tzf $@/sourcemeta-std-v$(VERSION).tar.gz

0 commit comments

Comments
 (0)