-
Notifications
You must be signed in to change notification settings - Fork 0
71 lines (65 loc) · 2.11 KB
/
Copy pathsync.yml
File metadata and controls
71 lines (65 loc) · 2.11 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
name: Sync grammar from fe
# This repository is a generated mirror of the Fe tree-sitter grammar, whose
# source lives in argotorg/fe at crates/tree-sitter-fe (where the generated
# parser is NOT tracked). This workflow regenerates the parser here so editor
# integrations have a stable git tree (with src/parser.c) to clone and build.
#
# - main tracks argotorg/fe@master (auto-committed when the grammar changes)
# - each fe release tag is mirrored to a matching tag here + a GitHub release
#
# It only ever reads the public fe repo and writes to THIS repo using the
# built-in GITHUB_TOKEN, so no cross-repo credentials are involved.
on:
schedule:
- cron: "0 6 * * *" # daily
workflow_dispatch:
inputs:
fe_ref:
description: "argotorg/fe ref (branch, tag, or commit SHA) to sync main from"
default: master
permissions:
contents: write
concurrency:
group: sync-grammar
cancel-in-progress: false
jobs:
main:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: main
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: 20
- name: Sync grammar from fe
run: scripts/sync-from-fe.sh "${{ github.event.inputs.fe_ref || 'master' }}"
- name: Commit if the grammar changed
run: |
git config user.name "fe-grammar-bot"
git config user.email "actions@github.com"
if [ -z "$(git status --porcelain)" ]; then
echo "No grammar changes."
exit 0
fi
src="$(cat .source-commit)"
git add -A
git commit -m "Sync grammar from argotorg/fe@${src:0:12}"
git push origin HEAD:main
releases:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: main
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: 20
- name: Setup Emscripten
uses: mymindstorm/setup-emsdk@v14
- name: Mirror new fe release tags
env:
GH_TOKEN: ${{ github.token }}
run: scripts/mirror-releases.sh