mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-11-13 09:17:21 +03:00
8a6f3f7e9d
https://github.com/hasura/graphql-engine-mono/pull/1534 GitOrigin-RevId: 67723bb64e2505c665b04b5b0d691e5599843f87
45 lines
1.0 KiB
Makefile
45 lines
1.0 KiB
Makefile
BUILDDIR := bin
|
|
BINARY_ASSETS := $(BUILDDIR)/cli-ext-hasura-node12-linux-x64 $(BUILDDIR)/cli-ext-hasura-node12-macos-x64 $(BUILDDIR)/cli-ext-hasura-node12-win-x64.exe $(BUILDDIR)/cli-ext-hasura-node12-linux-arm64 $(BUILDDIR)/cli-ext-hasura-node16-macos-arm64
|
|
BINARY_ASSET_CHECKSUMS := $(patsubst %,%.sha256,$(BINARY_ASSETS))
|
|
|
|
COMPRESS := gzip --best -k -c
|
|
|
|
deps:
|
|
npm install
|
|
|
|
ci-deps:
|
|
if [ ! -d "node_modules" ]; then npm ci; fi
|
|
|
|
ci-copy-assets:
|
|
mkdir -p /build/_cli_ext_output
|
|
cp $(BUILDDIR)/* /build/_cli_ext_output/
|
|
|
|
# Not supported: Refer https://github.com/zeit/pkg/issues/50
|
|
upx-compress: $(BUILDDIR)
|
|
ls $(BUILDDIR)/cli-ext-hasura-* | xargs upx
|
|
|
|
.PRECIOUS: %.zip
|
|
%.zip: %.exe
|
|
cd $(BUILDDIR) && \
|
|
zip $(patsubst $(BUILDDIR)/%, %, $@) $(patsubst $(BUILDDIR)/%, %, $<)
|
|
|
|
.PRECIOUS: %.gz
|
|
%.gz: %
|
|
$(COMPRESS) "$<" > "$@"
|
|
|
|
%.tar: %
|
|
tar cf "$@" -C $(BUILDDIR) $(patsubst $(BUILDDIR)/%,%,$^)
|
|
|
|
%.sha256: %
|
|
shasum -a 256 $< > $@
|
|
|
|
.PHONY: build
|
|
build:
|
|
npm run build
|
|
$(MAKE) $(BINARY_ASSET_CHECKSUMS)
|
|
|
|
.PHONY: clean
|
|
clean:
|
|
$(RM) -r $(BUILDDIR)
|
|
|