From b543ea03a619169fbd11ad60d56da17ebb50f529 Mon Sep 17 00:00:00 2001 From: Martin Elsman Date: Wed, 8 Apr 2020 00:02:18 +0200 Subject: [PATCH] binary distributions --- .travis.yml | 16 ++++++++++++++-- Makefile | 18 +++++++++++++++++- 2 files changed, 31 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 0dd4ce1..dbcbaf0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,9 +14,21 @@ before_install: - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get install -y mlton make ; fi install: - - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then make clean all ; fi - - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then MLCOMP=mlton make clean all ; fi + - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then make clean all bin_dist ; fi + - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then MLCOMP=mlton make clean all bin_dist ; fi script: - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then make test ; fi - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then MLCOMP=mlton make test ; fi + +deploy: + provider: releases + api_key: + secure: e33a62d591a6e3582935f37d502e83a091a1fbae + file_glob: true + file: smlpkg-bin-dist-*.tgz + skip_cleanup: true + on: + repo: diku-dk/smlpkg + tags: true + branch: master diff --git a/Makefile b/Makefile index f5cedf5..969b07e 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,7 @@ prefix ?= . INSTALLDIR ?= $(prefix)/bin INSTALL ?= install +OS=$(shell uname -s | tr '[:upper:]' '[:lower:]') .PHONY: all all: src/smlpkg @@ -19,7 +20,22 @@ test: .PHONY: clean clean: $(MAKE) -C src clean - rm -rf *~ .*~ bin + rm -rf *~ .*~ bin smlpkg-bin-* src/smlpkg: $(MAKE) -C src all + +# ----------------------------------------------------- +# Target for building binary distribution for smlpkg +# ----------------------------------------------------- + +BIN_DIST_DIR=smlpkg-bin-dist-$(OS) +.PHONY: bin_dist +bin_dist: src/smlpkg + rm -rf smlpkg-bin-dist-* + mkdir $(BIN_DIST_DIR) + $(MAKE) install INSTALLDIR=$(BIN_DIST_DIR)/bin/ + $(INSTALL) LICENSE $(BIN_DIST_DIR)/ + echo 'Binary package for smlpkg.' > $(BIN_DIST_DIR)/README + echo 'The sources are available at http://github.com/diku-dk/smlpkg' >> $(BIN_DIST_DIR)/README + tar czvf $(BIN_DIST_DIR).tgz $(BIN_DIST_DIR)