aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.github/workflows/build.yml139
-rw-r--r--.travis.yml125
2 files changed, 139 insertions, 125 deletions
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
new file mode 100644
index 0000000..532c1f7
--- /dev/null
+++ b/.github/workflows/build.yml
@@ -0,0 +1,139 @@
1name: Build
2on: pull_request
3
4jobs:
5 build-viewer:
6 runs-on: ubuntu-20.04
7 steps:
8 - uses: actions/checkout@v2
9 - uses: actions/setup-node@v1
10 with:
11 # Latest version officially tested for Vue
12 node-version: 12.16.1
13 - name: Lint and build Node.js Vue project
14 working-directory: viewer
15 run: |
16 npm install
17 npm run lint
18 npm run build
19 - uses: actions/upload-artifact@v2
20 with:
21 name: viewer-dist
22 path: viewer/dist
23
24 # TODO: do not hard-code the CI install path in the output binary
25 # See https://github.com/ldgallery/ldgallery/issues/286
26 build-compiler:
27 strategy:
28 fail-fast: false
29 matrix:
30 os: [ ubuntu-20.04, windows-2019 ]
31 runs-on: ${{ matrix.os }}
32 steps:
33 - uses: actions/checkout@v2
34 - uses: actions/cache@v2
35 with:
36 path: ~/.stack
37 key: compiler-${{ runner.os }}-${{ hashFiles('compiler/stack.yaml') }}
38 - uses: haskell/actions/setup@v1
39 with:
40 ghc-version: 8.10.4
41 enable-stack: true
42 - name: Build Haskell Stack project
43 working-directory: compiler
44 shell: bash
45 run: |
46 STACK_ROOT=~/.stack # make it the same on all platforms
47 stack setup --no-terminal
48 stack build --no-terminal
49 stack install --local-bin-path dist
50 - uses: actions/upload-artifact@v2
51 with:
52 name: compiler-dist-${{ matrix.os }}
53 path: compiler/dist
54
55 # TODO: generate a distro-agnostic Linux package.
56 # See https://github.com/ldgallery/ldgallery/issues/285
57 archive-linux:
58 needs: [ build-viewer, build-compiler ]
59 runs-on: ubuntu-20.04
60 steps:
61 - uses: actions/checkout@v2
62 - name: Bundle ldgallery viewer
63 uses: actions/download-artifact@v2
64 with:
65 name: viewer-dist
66 path: dist/viewer
67 - name: Bundle ldgallery compiler
68 uses: actions/download-artifact@v2
69 with:
70 name: compiler-dist-ubuntu-20.04
71 path: dist
72 - name: Install build dependencies
73 run: |
74 sudo apt-get update -qq
75 sudo apt-get install -y pandoc
76 - name: Build manuals
77 run: |
78 pandoc --standalone --to man ldgallery-quickstart.7.md --output dist/ldgallery-quickstart.7
79 pandoc --standalone --to man compiler/ldgallery.1.md --output dist/ldgallery.1
80 pandoc --standalone --to man viewer/ldgallery-viewer.7.md --output dist/ldgallery-viewer.7
81 cp changelog.md dist/
82 cp license.md dist/
83 - uses: actions/upload-artifact@v2
84 with:
85 name: archive-linux-amd64
86 path: dist
87
88 archive-windows:
89 needs: [ build-viewer, build-compiler ]
90 runs-on: ubuntu-20.04
91 steps:
92 - uses: actions/checkout@v2
93 - uses: actions/cache@v2
94 with:
95 path: ~/downloads
96 key: archive-windows-vendored
97 - name: Bundle ldgallery viewer
98 uses: actions/download-artifact@v2
99 with:
100 name: viewer-dist
101 path: dist/viewer
102 - name: Bundle ldgallery compiler
103 uses: actions/download-artifact@v2
104 with:
105 name: compiler-dist-windows-2019
106 path: dist
107 - name: Install build dependencies
108 run: |
109 sudo apt-get update -qq
110 sudo apt-get install -y pandoc wget curl html-xml-utils p7zip-full
111 - name: Copy scripts
112 run: |
113 mkdir dist/scripts
114 cp scripts/win_* dist/scripts/
115 - name: Build manuals
116 run: |
117 pandoc --standalone --to html ldgallery-quickstart.7.md --output dist/ldgallery-quickstart.7.html
118 pandoc --standalone --to html compiler/ldgallery.1.md --output dist/ldgallery.1.html
119 pandoc --standalone --to html viewer/ldgallery-viewer.7.md --output dist/ldgallery-viewer.7.html
120 pandoc --standalone --to html changelog.md --output dist/changelog.html
121 pandoc --standalone --to html license.md --output dist/license.html
122 - name: Bundle ImageMagick
123 run: |
124 MAGICK_ARCHIVES="https://download.imagemagick.org/ImageMagick/download/binaries/"
125 MAGICK_LATEST=$( \
126 curl --silent "$MAGICK_ARCHIVES" \
127 | hxclean \
128 | hxselect 'a::attr(href)' -c -s '\n' \
129 | grep -m1 '^ImageMagick-7.*portable-Q16-HDRI-x64.zip$' )
130 mkdir -p ~/downloads
131 wget --timestamping --directory-prefix ~/downloads "$MAGICK_ARCHIVES/$MAGICK_LATEST"
132 7z e ~/downloads/"$MAGICK_LATEST" -odist/ magick.exe
133 7z e ~/downloads/"$MAGICK_LATEST" -so LICENSE.txt > dist/magick.license.txt
134 7z e ~/downloads/"$MAGICK_LATEST" -so NOTICE.txt > dist/magick.notice.txt
135 7z e ~/downloads/"$MAGICK_LATEST" -so README.txt > dist/magick.readme.txt
136 - uses: actions/upload-artifact@v2
137 with:
138 name: archive-win64
139 path: dist
diff --git a/.travis.yml b/.travis.yml
deleted file mode 100644
index 23be533..0000000
--- a/.travis.yml
+++ /dev/null
@@ -1,125 +0,0 @@
1language: generic
2
3jobs:
4 include:
5 - name: release-linux
6 language: generic
7 dist: bionic
8
9 deploy:
10 provider: releases
11 edge: true
12 token:
13 secure: zRJV96jl3zchT88YAtT6irCXgm96qVcIokVmCHrzcAXsRHgTHQURKcdpPzFdZQnNkxwfS1akA3fW5icr+U6WZIxIe56sHYEaBg7VXR1RiGW/qNOAhSvbJGva75iUllTiELa2FL2gEb8bNhVOy3+bQr5Z7RMeHFiC4FFmbMvaQhd5ss3yR5+bqKufEuJPDpFap93XHUoczXH+lXp1v90Cia1gskHsSl+YgfGWQAc89yOxETwFOSqr3CScZGV6oJpGM2rsflN5arFS/8JqDwuemttfrt74wDdKR4Mk94tcqXqMrledUsXR1NEjWAEWW6QMj05ztZ76TkT2hKpG+WVmUTaJjNKS+RJnf4WKzv1vo2EHZuAuPvwR21NGVYTxvV4o3Zvs4YODGXiUxQgeF5LFA3jbZw9ODyloStUV7zIPqzL7qJEIehnMtkjo2JPav5ORz6B7GwVrDC4LJHn95on3/3Voo3mPeyepoz1gFoh3iovTKAc+IXQXGOhT7cATP9DAWLO/Epct7hWPCEflm+oSS4rNiVbMW/61O3yIpxgkJ/oTsixLk6LOhWNdr2hfP95nAtD+It7LSsJABmWJ0FVO9RtQC7fLmEPaoGdZIdeRk/0yig9vA78Y+q46B6LBalmZO+0V60rdLdrnggJsyt3DZKM/4Z+QUwe494NodE7hU9U=
14 on:
15 tags: true
16 overwrite: true
17 cleanup: false
18 file: ldgallery-linux-amd64.tar.gz
19
20 cache:
21 directories:
22 - viewer/node_modules
23 - "$HOME/.stack"
24
25 before_install:
26 - nvm install 12.16.2
27 - nvm use 12.16.2
28 - mkdir -p ~/.local/bin
29 - export PATH=$HOME/.local/bin:$PATH
30 - travis_retry curl -L https://get.haskellstack.org/stable/linux-x86_64.tar.gz
31 | tar xz --wildcards --strip-components=1 -C ~/.local/bin '*/stack'
32 - sudo apt-get update -qq
33 - sudo apt-get install -y pandoc
34
35 install:
36 - cd viewer
37 - npm install
38 - cd ..
39 - cd compiler
40 - stack setup --no-terminal
41 - cd ..
42
43 script:
44 - mkdir dist
45 - cd viewer
46 - npm run lint
47 - npm run build -- --dest ../dist/viewer
48 - cd ..
49 - cd compiler
50 - stack build --no-terminal
51 - stack install --local-bin-path ../dist/
52 - cd ..
53 - pandoc --standalone --to man ldgallery-quickstart.7.md --output dist/ldgallery-quickstart.7
54 - pandoc --standalone --to man compiler/ldgallery.1.md --output dist/ldgallery.1
55 - pandoc --standalone --to man viewer/ldgallery-viewer.7.md --output dist/ldgallery-viewer.7
56 - cp changelog.md license.md dist/
57 - tar -cvzf ldgallery-linux-amd64.tar.gz dist
58
59 #=============================================================
60
61 - name: release-win64
62 if: tag IS present OR branch IN (master, staging)
63 language: shell
64 os: windows
65
66 deploy:
67 provider: releases
68 edge: true
69 token:
70 secure: zRJV96jl3zchT88YAtT6irCXgm96qVcIokVmCHrzcAXsRHgTHQURKcdpPzFdZQnNkxwfS1akA3fW5icr+U6WZIxIe56sHYEaBg7VXR1RiGW/qNOAhSvbJGva75iUllTiELa2FL2gEb8bNhVOy3+bQr5Z7RMeHFiC4FFmbMvaQhd5ss3yR5+bqKufEuJPDpFap93XHUoczXH+lXp1v90Cia1gskHsSl+YgfGWQAc89yOxETwFOSqr3CScZGV6oJpGM2rsflN5arFS/8JqDwuemttfrt74wDdKR4Mk94tcqXqMrledUsXR1NEjWAEWW6QMj05ztZ76TkT2hKpG+WVmUTaJjNKS+RJnf4WKzv1vo2EHZuAuPvwR21NGVYTxvV4o3Zvs4YODGXiUxQgeF5LFA3jbZw9ODyloStUV7zIPqzL7qJEIehnMtkjo2JPav5ORz6B7GwVrDC4LJHn95on3/3Voo3mPeyepoz1gFoh3iovTKAc+IXQXGOhT7cATP9DAWLO/Epct7hWPCEflm+oSS4rNiVbMW/61O3yIpxgkJ/oTsixLk6LOhWNdr2hfP95nAtD+It7LSsJABmWJ0FVO9RtQC7fLmEPaoGdZIdeRk/0yig9vA78Y+q46B6LBalmZO+0V60rdLdrnggJsyt3DZKM/4Z+QUwe494NodE7hU9U=
71 on:
72 tags: true
73 overwrite: true
74 cleanup: false
75 file: ldgallery-win64.zip
76
77 cache:
78 directories:
79 - viewer/node_modules
80 - "$HOME/.stack"
81
82 env:
83 - NVM_HOME="$ProgramData/nvm/"
84 - NVM_SYMLINK="$ProgramData/nvm/nodejs/"
85 - STACK_ROOT="$ProgramData/haskell/"
86
87 before_install:
88 - export "PATH=$NVM_HOME:$NVM_SYMLINK:$STACK_ROOT:$PATH"
89 - echo $PATH
90 - choco install nvm
91 - nvm install 12.16.2
92 - nvm use 12.16.2
93 - choco install haskell-stack
94
95 install:
96 - cd viewer
97 - npm install
98 - cd ..
99 - cd compiler
100 - stack setup --no-terminal
101 - cd ..
102
103 script:
104 - mkdir dist
105 - cd viewer
106 - npm run lint