-
Notifications
You must be signed in to change notification settings - Fork 2
86 lines (74 loc) · 2.62 KB
/
build-grammars.yml
File metadata and controls
86 lines (74 loc) · 2.62 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
name: Build & Deploy Grammars
on:
push:
branches: [master]
paths:
- "extensions/**/extension.json"
- "extensions/**/*.scm"
- "grammar-sources.json"
workflow_dispatch:
inputs:
languages:
description: "Comma-separated language IDs to rebuild (empty = all missing)"
required: false
type: string
jobs:
build-grammars:
if: github.repository == 'athasdev/extensions'
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- name: Install tree-sitter CLI
run: npm install -g tree-sitter-cli
- name: Build parser.wasm files
run: bun run scripts/build-grammars.ts ${{ inputs.languages && format('--languages {0}', inputs.languages) || '' }}
- name: Upload grammar artifacts
uses: actions/upload-artifact@v4
with:
name: parser-wasm-files
path: extensions/*/parser.wasm
retention-days: 30
deploy-grammars:
needs: build-grammars
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Download grammar artifacts
uses: actions/download-artifact@v4
with:
name: parser-wasm-files
path: extensions/
- name: List built grammars
run: find extensions -name "parser.wasm" -exec ls -lh {} \;
- name: Deploy to CDN via SSH
uses: appleboy/ssh-action@v1.0.3
with:
host: ${{ secrets.VPS_HOST }}
username: ${{ secrets.VPS_USER }}
key: ${{ secrets.VPS_SSH_KEY }}
port: ${{ secrets.VPS_PORT || 22 }}
script: echo "CDN ready for rsync"
- name: Sync grammars to CDN
uses: burnett01/rsync-deployments@7.0.2
with:
switches: -avz --include='*/' --include='parser.wasm' --include='*.json' --include='*.scm' --exclude='*'
path: extensions/
remote_path: ${{ secrets.EXTENSIONS_CDN_ROOT }}/
remote_host: ${{ secrets.VPS_HOST }}
remote_user: ${{ secrets.VPS_USER }}
remote_key: ${{ secrets.VPS_SSH_KEY }}
remote_port: ${{ secrets.VPS_PORT || 22 }}
- name: Sync catalog files to CDN
uses: burnett01/rsync-deployments@7.0.2
with:
switches: -avz
path: registry.json index.json manifests.json
remote_path: ${{ secrets.EXTENSIONS_CDN_ROOT }}/
remote_host: ${{ secrets.VPS_HOST }}
remote_user: ${{ secrets.VPS_USER }}
remote_key: ${{ secrets.VPS_SSH_KEY }}
remote_port: ${{ secrets.VPS_PORT || 22 }}