on master help sign in
add Travis CI Linux x86_64 build and tags releases
1a45b8eRémi Lefèvre
.gitignore+1
@@ -5,3 +5,4 @@ cabal-dev
5cabal.sandbox.config
5cabal.sandbox.config
6.DS_Store
6.DS_Store
7*~
7*~
8+travis.log
.travis.ymlnew file+28
@@ -0,0 +1,28 @@
1+language: minimal
2+services: docker
3+
4+env:
5+ global:
6+ - LINUX_ARCHIVE=binary-for-linux-64-bit.gz
7+
8+before_install:
9+ - docker build -t elm -f installers/linux/Dockerfile .
10+ - docker cp $(docker create elm):/usr/local/bin/elm .
11+ - gzip -9 -c elm > $LINUX_ARCHIVE
12+
13+deploy:
14+ provider: releases
15+ api_key:
16+ secure: Yz2Lo4u9rZQ7Ee7ohAsrZpkqsYDUerCSMdSQIH8ryrf7phHhiloPEkTKsM+NupHqU/LEAVsunxbau4QrCEjA2vPavAPVk8cKomRUWK/YjbXHKa24hPkal2c+A2bnMQ6w3qYk/PjL9rW+Goq++/SNLcYZwHBV0Chl2blivMwWCSA=
17+ file: $LINUX_ARCHIVE
18+ skip_cleanup: true
19+ on:
20+ branch: master
21+ tags: true
22+
23+notifications:
24+ email:
25+ recipients:
26+ - rlefevre@dmy.fr
27+ on_success: change
28+ on_failure: change
installers/linux/Dockerfile+33−19
@@ -1,25 +1,39 @@
1−# Create: https://gist.github.com/rlefevre/1523f47e75310e28eee243c9c5651ac9
1+# Based initially on https://gist.github.com/rlefevre/1523f47e75310e28eee243c9c5651ac9
2+#
3+# Build Linux x64 binary from elm compiler top-level directory:
4+# $ docker build -t elm -f installers/linux/Dockerfile .
5+#
6+# Retrieve elm Linux binary:
7+# $ docker cp $(docker create elm):/usr/local/bin/elm DESTINATION_DIRECTORY
8+#
9+# Delete docker elm image:
10+# $ docker rmi elm
11+#
12+# Display all images:
13+# $ docker images -a
14+#
15+# Delete all unused docker images:
2−# Delete: docker system prune -a ; docker images -a
16+# $ docker system prune -a
3
17
18+# Use Alpine 3.11 with GHC 8.6.5
4−FROM alpine:3.10
19+FROM alpine:3.11
5
20
6−# branch
21+# Install packages required to build elm
7−ARG branch=master
22+RUN apk add --no-cache ghc cabal wget musl-dev zlib-dev zlib-static ncurses-dev ncurses-static
8−# commit or tag
9−ARG commit=HEAD
10
23
11−# Install required packages
24+WORKDIR /elm
12−RUN apk add --update ghc cabal git musl-dev zlib-dev ncurses-dev ncurses-static wget
13
25
14−# Checkout elm compiler
26+# Import source code
15−WORKDIR /tmp
27+COPY builder builder/
16−RUN git clone -b $branch https://github.com/elm/compiler.git
28+COPY compiler compiler
29+COPY reactor reactor/
30+COPY terminal terminal/
31+COPY cabal.config elm.cabal LICENSE ./
17
32
18−# Build a statically linked elm binary
33+# Build statically linked elm binary
19−WORKDIR /tmp/compiler
20−RUN git checkout $commit
21−RUN rm worker/elm.cabal
22RUN cabal new-update
34RUN cabal new-update
23−RUN cabal new-configure --disable-executable-dynamic --ghc-option=-optl=-static --ghc-option=-optl=-pthread
35+RUN cabal new-build --ghc-option=-optl=-static --ghc-option=-split-sections
24−RUN cabal new-build
25−RUN strip -s ./dist-newstyle/build/x86_64-linux/ghc-8.4.3/elm-0.19.1/x/elm/build/elm/elm
36+RUN cp ./dist-newstyle/build/x86_64-linux/ghc-*/elm-*/x/elm/build/elm/elm /usr/local/bin/elm
37+
38+# Remove debug symbols to optimize the binary size
39+RUN strip -s /usr/local/bin/elm