From 01fc05f04f3b043fe863f29dad953a2ca1f80fcd Mon Sep 17 00:00:00 2001 From: pacien Date: Mon, 28 Jun 2021 19:07:23 +0200 Subject: ci: configure GitHub Actions This configures GitHub Actions for building the viewer and compiler components and produce archive bundles for Linux and Windows. Those are uploaded as build artifacts instead of automatically being attached to releases like before with Travis CI. This allows manually checking the archives when doing new releases. --- .github/workflows/build.yml | 124 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 124 insertions(+) create mode 100644 .github/workflows/build.yml (limited to '.github/workflows') diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..aef142b --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,124 @@ +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 -- cgit v1.2.3