-
Notifications
You must be signed in to change notification settings - Fork 29
77 lines (66 loc) · 2.33 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
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: Update NPM (Windows)
shell: bash
if: matrix.os == 'windows-latest'
# See https://github.com/nodejs/node/issues/52682
run: cd widget/ && npm install npm
- name: Build package
run: lake build ProofWidgets
- 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: 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') }}
- name: Upload release archive (Ubuntu)
if: github.ref_type == 'tag' && matrix.os == 'ubuntu-latest'
run: lake upload $RELEASE_TAG
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
RELEASE_TAG: ${{ github.ref_name }}
- name: Test release archive (Ubuntu)
if: github.ref_type == 'tag' && matrix.os == 'ubuntu-latest'
run: lake clean && lake build :release && lake build --no-build
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}