Skip to content

Commit

Permalink
binary distributions
Browse files Browse the repository at this point in the history
  • Loading branch information
melsman committed Apr 7, 2020
1 parent dfcb1ef commit b543ea0
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 3 deletions.
16 changes: 14 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
18 changes: 17 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
prefix ?= .
INSTALLDIR ?= $(prefix)/bin
INSTALL ?= install
OS=$(shell uname -s | tr '[:upper:]' '[:lower:]')

.PHONY: all
all: src/smlpkg
Expand All @@ -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)

0 comments on commit b543ea0

Please sign in to comment.