-
Notifications
You must be signed in to change notification settings - Fork 48
64 lines (61 loc) · 2.21 KB
/
deploy-to-github.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
name: Deploy to GitHub
on:
push:
tags:
- '*'
workflow_dispatch:
jobs:
deploy:
runs-on: ubuntu-latest
env:
EMSCRIPTEN_VERSION: '3.1.29'
steps:
- uses: actions/checkout@v3
- name: Set up Node
uses: actions/setup-node@v3
with:
node-version: '18'
- name: Install Emscripten
uses: mymindstorm/setup-emsdk@v12
with:
version: ${{ env.EMSCRIPTEN_VERSION }}
- name: Install dependencies
run: npm install
- name: Compile grammar
run: npm run generate
- name: Build WASM binary
run: npm run build-wasm
- name: Deploy to GitHub Releases
if: github.event_name != 'workflow_dispatch'
uses: ncipollo/release-action@v1
with:
artifacts: tree-sitter-kotlin.wasm
token: ${{ secrets.GITHUB_TOKEN }}
# TODO: Update this to the new playground layout. This would
# involve deploying the Wasm binary to
#
# assets/tree-sitter-kotlin-<version>/tree-sitter-kotlin.wasm
#
# and would also require rewriting the versions in the
# index.html (both the reference to the parser binary and the
# displayed version). Ideally this should be performed by a
# script that generates the index.html automatically. Perhaps
# we could even generate this to automatically download
# web-tree-sitter and maybe even generate playground.js from
# the upstream playground.
#
# Also, we would likely want to replace peaceiris/actions-gh-pages
# with the `gh` command-line tool, which should already be
# preinstalled in the runner.
# - name: Set up folder for GitHub Pages deployment
# run: |
# mkdir public
# cp tree-sitter-kotlin.wasm public/tree-sitter-parser.wasm
# - name: Deploy to GitHub Pages
# uses: peaceiris/actions-gh-pages@v3
# with:
# github_token: ${{ secrets.GITHUB_TOKEN }}
# publish_dir: ./public
# keep_files: true
# user_name: 'github-actions[bot]'
# user_email: 'github-actions[bot]@users.noreply.github.com'