Skip to content

Update Node dependencies #1158

Update Node dependencies

Update Node dependencies #1158

Workflow file for this run

name: Build
on:
push:
branches:
- main
pull_request:
branches:
- '*'
jobs:
build:
strategy:
matrix:
os:
- ubuntu-latest
node-version:
- 16
- 18
include:
- os: ubuntu-latest
node-version: '16'
primary: true
runs-on: ${{ matrix.os }}
outputs:
version: ${{ steps.package_info.outputs.version }}
steps:
- uses: actions/checkout@v3
- name: Current version
id: package_info
run: |
VERSION=$(node -e 'console.log(require("./package.json").version)')
echo "::set-output name=version::v$VERSION"
- name: Set up Node ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
# libgbm-dev is required by Puppeteer 3+
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y libgbm-dev ghostscript poppler-utils
if: ${{ runner.os == 'Linux' }}
- name: Install dependencies
run: |
npm ci
- name: Lint and test
run: |
npm run lint
npm t
- name: Setup Docker
# taken from https://github.com/docker/github-actions/blob/0f18e2abad9a4ac2963d2516246787375b5ec917/Dockerfile#L32
run: curl -fL https://download.docker.com/linux/static/stable/x86_64/docker-20.10.4.tgz | tar xzO docker/docker > docker && sudo mv -f docker /usr/bin/docker && sudo chmod +x /usr/bin/docker
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Build container image
run: make packageLocalDocker
- name: Smoke test
run: make testDocker
- name: Build binary
run: |
npm run build
if: matrix.primary
- name: Upload Windows artifact
uses: actions/upload-artifact@v3
with:
name: win-binary
path: build/asciidoctor-web-pdf-win.zip
if: matrix.primary
- name: Upload macOS artifact
uses: actions/upload-artifact@v3
with:
name: mac-binary
path: build/asciidoctor-web-pdf-mac.zip
if: matrix.primary
- name: Upload Linux artifact
uses: actions/upload-artifact@v3
with:
name: linux-binary
path: build/asciidoctor-web-pdf-linux.zip
if: matrix.primary
test-linux:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v3
with:
name: linux-binary
- name: Unzip
run: |
unzip asciidoctor-web-pdf-linux.zip -d out
- name: Smoke test
run: |
cd out/asciidoctor-web-pdf-linux-${{ needs.build.outputs.version }}
rm -rf basic.pdf
./asciidoctor-web-pdf ./examples/document/basic-example.adoc -o basic.pdf
ls basic.pdf
test -f basic.pdf -a -s basic.pdf
test-macos:
needs: build
runs-on: macos-latest
steps:
- uses: actions/download-artifact@v3
with:
name: mac-binary
- name: Unzip
run: |
unzip asciidoctor-web-pdf-mac.zip -d out
- name: Smoke test
run: |
cd out/asciidoctor-web-pdf-mac-${{ needs.build.outputs.version }}
rm -rf basic.pdf
./asciidoctor-web-pdf ./examples/document/basic-example.adoc -o basic.pdf
ls basic.pdf
test -f basic.pdf -a -s basic.pdf
test-win:
needs: build
runs-on: windows-latest
steps:
- uses: actions/download-artifact@v3
with:
name: win-binary
- name: Unzip
run: |
unzip asciidoctor-web-pdf-win.zip -d out
- name: Smoke test
run: |
cd out\asciidoctor-web-pdf-win-${{ needs.build.outputs.version }}
asciidoctor-web-pdf.exe examples\document\basic-example.adoc -o basic.pdf
ls basic.pdf
shell: cmd