blob: a0b43a7066ff759ae1ed1db9f7f04a54dc6f7666 [file] [log] [blame] [edit]
name: Emscripten
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
js-build:
name: Build liblouis for js
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
# Contains tests and js snippets appended to builds. liblouis-js
# version should be incremented by hand, to keep the repositories
# in sync.
- name: Obtain liblouis-js
run: git clone https://github.com/liblouis/liblouis-js.git
- name: Pull the docker image
run: docker pull dolp/liblouis-js-build-travis:1.37.3-64bit
- name: Run the docker image
run: docker run --rm -v $(pwd):/src dolp/liblouis-js-build-travis:1.37.3-64bit /bin/bash ".github/workflows/scripts/emscripten-build.sh"
- name: Move the build result to a better place
run: |
cp -r ./out/* ./liblouis-js/js-build
cp -r ./out-emscripten-install/share/liblouis/tables ./liblouis-js/js-build/
- name: Echo phantomjs version
run: phantomjs --version
# `npm link` exposes the newly build npm package to the test
# runner. The `--production`-flag is necessary as it ensures that
# no publicly published package of the build is downloaded and
# tested instead.
- name: Build and test the npm package
run: |
cd ./liblouis-js
# FIXME: unclear why the npm link is needed
sudo npm link js-build --production
npm test
cd ..
- name: Upload the release assets
uses: actions/upload-artifact@v2
with:
name: build-no-tables-utf32.js
path: ./out/build-no-tables-utf32.js
- name: Upload the assets to the snapshot release
# only upload to snapshot page if it is a push to master in the main repo
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' && github.repository =='liblouis/liblouis'}}
uses: shogo82148/actions-upload-release-asset@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
upload_url: https://uploads.github.com/repos/liblouis/liblouis/releases/8031256/assets{?name,label}
asset_path: ./out/build-no-tables-utf32.js
asset_name: build-no-tables-utf32.js
asset_content_type: application/javascript
overwrite: true