name: Build on: pull_request jobs: build-viewer: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - uses: actions/setup-node@v1 with: node-version: 12.x - name: Lint and build Node.js Vue project working-directory: viewer run: | npm install npm run lint npm run build - uses: actions/upload-artifact@v2 with: name: viewer-dist path: viewer/dist # TODO: do not hard-code the CI install path in the output binary # See https://github.com/ldgallery/ldgallery/issues/286 build-compiler: strategy: fail-fast: false matrix: os: [ ubuntu-latest, windows-latest ] runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v2 - uses: haskell/actions/setup@v1 with: ghc-version: 8.10.4 enable-stack: true - name: Build Haskell Stack project working-directory: compiler run: | stack setup --no-terminal stack build --no-terminal stack install --local-bin-path dist - uses: actions/upload-artifact@v2 with: name: compiler-dist-${{ matrix.os }} path: compiler/dist # TODO: generate a distro-agnostic Linux package. # See https://github.com/ldgallery/ldgallery/issues/285 archive-linux: needs: [ build-viewer, build-compiler ] runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - name: Bundle ldgallery viewer uses: actions/download-artifact@v2 with: name: viewer-dist path: dist/viewer - name: Bundle ldgallery compiler uses: actions/download-artifact@v2 with: name: compiler-dist-ubuntu-latest path: dist - name: Install build dependencies run: | sudo apt-get update -qq sudo apt-get install -y pandoc - name: Build manuals run: | pandoc --standalone --to man ldgallery-quickstart.7.md --output dist/ldgallery-quickstart.7 pandoc --standalone --to man compiler/ldgallery.1.md --output dist/ldgallery.1 pandoc --standalone --to man viewer/ldgallery-viewer.7.md --output dist/ldgallery-viewer.7 cp changelog.md dist/ cp license.md dist/ - uses: actions/upload-artifact@v2 with: name: archive-linux-amd64 path: dist archive-windows: needs: [ build-viewer, build-compiler ] runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - name: Bundle ldgallery viewer uses: actions/download-artifact@v2 with: name: viewer-dist path: dist/viewer - name: Bundle ldgallery compiler uses: actions/download-artifact@v2 with: name: compiler-dist-windows-latest path: dist - name: Install build dependencies run: | sudo apt-get update -qq sudo apt-get install -y pandoc wget p7zip-full - name: Copy scripts run: | mkdir dist/scripts cp scripts/win_* dist/scripts/ - name: Build manuals run: | pandoc --standalone --to html ldgallery-quickstart.7.md --output dist/ldgallery-quickstart.7.html pandoc --standalone --to html compiler/ldgallery.1.md --output dist/ldgallery.1.html pandoc --standalone --to html viewer/ldgallery-viewer.7.md --output dist/ldgallery-viewer.7.html pandoc --standalone --to html changelog.md --output dist/changelog.html pandoc --standalone --to html license.md --output dist/license.html # TODO: automatically get the latest imagemagick version, since old archives disappear from the website # See https://github.com/ldgallery/ldgallery/issues/281 - name: Bundle ImageMagick run: | wget -O magick.zip \ https://download.imagemagick.org/ImageMagick/download/binaries/ImageMagick-7.1.0-2-portable-Q16-x64.zip 7z e magick.zip -odist/ magick.exe 7z e magick.zip -so LICENSE.txt > dist/magick.license.txt 7z e magick.zip -so NOTICE.txt > dist/magick.notice.txt 7z e magick.zip -so README.txt > dist/magick.readme.txt - uses: actions/upload-artifact@v2 with: name: archive-win64 path: dist