Merge pull request #34 from dmitrylyzo/fix-npm-package #134
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Emscripten | |
on: | |
push: | |
branches: [main, ci] | |
pull_request: | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Cancel previous runs | |
uses: styfle/[email protected] | |
with: | |
access_token: ${{ github.token }} | |
all_but_latest: true | |
- name: Checkout Base Repo | |
uses: actions/checkout@v2 | |
- name: Checkout Submodules | |
run: | | |
git submodule sync | |
git submodule update --init --recursive --force | |
- name: Build Docker Image | |
run: | | |
docker build -t libass/jso . | |
- name: Build Binaries | |
run: | | |
docker run --rm -v "${PWD}":/code libass/jso:latest | |
- name: Upload Nightly Build | |
uses: actions/upload-artifact@v2 | |
if: (github.event_name == 'push' || github.event_name == 'workflow_dispatch') | |
with: | |
name: js | |
path: dist | |
update_gh-pages: | |
if: (github.event_name == 'push' || github.event_name == 'workflow_dispatch') && github.ref == 'refs/heads/main' | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
with: | |
ref: gh-pages | |
- name: Download nightly build | |
uses: actions/download-artifact@v3 | |
with: | |
name: js | |
path: jassub/assets | |
- name: Push new version | |
run: | | |
git config --global user.email "[email protected]" | |
git config --global user.name "GitHub Action" | |
git add jassub/assets | |
git commit -m "$(printf \ | |
"Update binaries to latest nightly\n\nFrom %s" "${{ github.sha }}")" | |
git push origin gh-pages |