diff options
72 files changed, 10765 insertions, 14793 deletions
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..190a0df --- /dev/null +++ b/.github/workflows/build.yml | |||
@@ -0,0 +1,141 @@ | |||
1 | name: Build | ||
2 | on: pull_request | ||
3 | |||
4 | jobs: | ||
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 Ld | ||
12 | node-version: 12.22.2 | ||
13 | - name: Lint and build Node.js Vue project | ||
14 | working-directory: viewer | ||
15 | run: | | ||
16 | yarn | ||
17 | yarn run lint | ||
18 | yarn 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 | --flag ldgallery-compiler:portable \ | ||
50 | --copy-bins \ | ||
51 | --local-bin-path dist | ||
52 | - uses: actions/upload-artifact@v2 | ||
53 | with: | ||
54 | name: compiler-dist-${{ matrix.os }} | ||
55 | path: compiler/dist | ||
56 | |||
57 | # TODO: generate a distro-agnostic Linux package. | ||
58 | # See https://github.com/ldgallery/ldgallery/issues/285 | ||
59 | archive-linux: | ||
60 | needs: [ build-viewer, build-compiler ] | ||
61 | runs-on: ubuntu-20.04 | ||
62 | steps: | ||
63 | - uses: actions/checkout@v2 | ||
64 | - name: Bundle ldgallery viewer | ||
65 | uses: actions/download-artifact@v2 | ||
66 | with: | ||
67 | name: viewer-dist | ||
68 | path: dist/viewer | ||
69 | - name: Bundle ldgallery compiler | ||
70 | uses: actions/download-artifact@v2 | ||
71 | with: | ||
72 | name: compiler-dist-ubuntu-20.04 | ||
73 | path: dist | ||
74 | - name: Install build dependencies | ||
75 | run: | | ||
76 | sudo apt-get update -qq | ||
77 | sudo apt-get install -y pandoc | ||
78 | - name: Build manuals | ||
79 | run: | | ||
80 | pandoc --standalone --to man ldgallery-quickstart.7.md --output dist/ldgallery-quickstart.7 | ||
81 | pandoc --standalone --to man compiler/ldgallery.1.md --output dist/ldgallery.1 | ||
82 | pandoc --standalone --to man viewer/ldgallery-viewer.7.md --output dist/ldgallery-viewer.7 | ||
83 | cp changelog.md dist/ | ||
84 | cp license.md dist/ | ||
85 | - uses: actions/upload-artifact@v2 | ||
86 | with: | ||
87 | name: archive-linux-amd64 | ||
88 | path: dist | ||
89 | |||
90 | archive-windows: | ||
91 | needs: [ build-viewer, build-compiler ] | ||
92 | runs-on: ubuntu-20.04 | ||
93 | steps: | ||
94 | - uses: actions/checkout@v2 | ||
95 | - uses: actions/cache@v2 | ||
96 | with: | ||
97 | path: ~/downloads | ||
98 | key: archive-windows-vendored | ||
99 | - name: Bundle ldgallery viewer | ||
100 | uses: actions/download-artifact@v2 | ||
101 | with: | ||
102 | name: viewer-dist | ||
103 | path: dist/viewer | ||
104 | - name: Bundle ldgallery compiler | ||