chore: store pre-built JS in source tree (#165) #771
Workflow file for this run
This file contains hidden or 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
| on: | |
| push: | |
| pull_request: | |
| name: ci | |
| jobs: | |
| build: | |
| name: ${{ matrix.name }} | |
| runs-on: ${{ matrix.os }} | |
| defaults: | |
| run: | |
| shell: ${{ matrix.shell || 'sh' }} | |
| strategy: | |
| matrix: | |
| include: | |
| - name: Build on Ubuntu | |
| os: ubuntu-latest | |
| # TODO: investigate why `lake build` deadlocks on macOS (issue #33) | |
| #- name: Build on macOS | |
| # os: macos-latest | |
| - name: Build on Windows | |
| os: windows-latest | |
| shell: msys2 {0} | |
| steps: | |
| - name: Install MSYS2 (Windows) | |
| if: matrix.os == 'windows-latest' | |
| uses: msys2/setup-msys2@v2 | |
| with: | |
| path-type: inherit | |
| install: curl unzip | |
| - name: Install elan | |
| shell: bash | |
| run: | | |
| curl -sSfLO https://raw.githubusercontent.com/leanprover/elan/master/elan-init.sh | |
| chmod +x elan-init.sh | |
| ./elan-init.sh -y --default-toolchain none | |
| echo "$HOME/.elan/bin" >> $GITHUB_PATH | |
| - uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '24' | |
| - name: Build package | |
| run: lake build ProofWidgets | |
| - name: Check pre-built JS is up-to-date | |
| run: git diff --exit-code widget/js/ | |
| - name: Try publishing @leanprover-community/proofwidgets4 | |
| if: ${{ startsWith(github.ref, 'refs/tags/v') && !contains(github.ref, '-pre') && matrix.os == 'ubuntu-latest' }} | |
| continue-on-error: true | |
| run: cd widget/ && npm publish --access=public | |
| - name: Build demos | |
| run: lake build ProofWidgets.Demos | |
| - name: Run tests | |
| run: lake test | |
| - name: Create GitHub release for tag (Ubuntu) | |
| if: github.ref_type == 'tag' && matrix.os == 'ubuntu-latest' | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| prerelease: ${{ contains(github.ref, '-pre') }} | |
| env: | |
| NPM_TOKEN: ${{ secrets.NPM_TOKEN }} |