-
Notifications
You must be signed in to change notification settings - Fork 0
69 lines (57 loc) · 1.79 KB
/
release.yml
File metadata and controls
69 lines (57 loc) · 1.79 KB
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
name: Release OCaml Binary and Deploy Github Pages
on:
push:
branches:
- master
jobs:
build:
strategy:
fail-fast: false
matrix:
os:
# - macos-latest
- ubuntu-latest
# we'll wait for windows to get v5.x support
# - windows-latest
ocaml-compiler:
# latest version supported by all platforms
- "5.1.x"
runs-on: ${{ matrix.os }}
steps:
- name: Checkout tree
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v3
with:
check-latest: true
- run: npm ci
working-directory: browser
- run: npm run build
working-directory: browser
- name: Cache OPAM
uses: actions/cache@v3
with:
path: ~/.opam
key: ${{ runner.os }}-opam-${{ matrix.ocaml-compiler }}-${{ hashFiles('**/*.opam') }}
restore-keys: ${{ runner.os }}-opam-${{ matrix.ocaml-compiler }}-
- name: Setup OCaml ${{ matrix.ocaml-compiler }}
uses: ocaml/setup-ocaml@v3
with:
ocaml-compiler: ${{ matrix.ocaml-compiler }}
- run: opam install . --deps-only
- run: opam exec -- dune build --release
- run: mv _build/default/bin/main.exe _build/${{ matrix.os }}.exe
- name: Create a release
uses: ncipollo/release-action@v1
with:
artifacts: _build/${{ matrix.os }}.exe
tag: master
commit: master
allowUpdates: true
- name: Create the straw html index.html
run: ./_build/${{ matrix.os }}.exe html > ./straw/index.html
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./straw