-
Notifications
You must be signed in to change notification settings - Fork 2
70 lines (63 loc) · 2.21 KB
/
update_from_monorepo.yaml
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
name: Update from monorepo
on:
schedule:
- cron: "29 * * * *"
workflow_dispatch:
jobs:
update:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- mono_repo_ref: release/1
this_ref: master
- mono_repo_ref: master
this_ref: nightly
steps:
- name: Check out monorepo
uses: actions/checkout@v4
with:
repository: slint-ui/slint
ref: ${{ matrix.mono_repo_ref}}
sparse-checkout: editors/tree-sitter-slint
path: monorepo
- name: Check out tree-sitter-slint repo
uses: actions/checkout@v4
with:
ref: ${{ matrix.this_ref}}
path: mine
- uses: robinraju/release-downloader@v1.9
with:
repository: "tree-sitter/tree-sitter"
latest: true
fileName: "tree-sitter-linux-x64.gz"
out-file-path: ${{ runner.workspace }}
- name: Extract tree-sitter-cli
run: |
gunzip tree-sitter-linux-x64.gz
chmod 755 tree-sitter-linux-x64
mv tree-sitter-linux-x64 tree-sitter
working-directory: ${{ runner.workspace }}
- name: Update grammar.js
run: |
cp monorepo/editors/tree-sitter-slint/grammar.js mine
( cd mine && "${{ runner.workspace }}/tree-sitter" generate )
# TODO: Remove after 1.7
- name: Relicense master branch
if: ${{ matrix.this_ref == 'master' }}
run: |
sed -ie "s!^// SPDX-License-Identifier: .*\$!// SPDX-License-Identifier: MIT!" grammar.js
working-directory: mine
- name: Git status
run: |
git status
git diff
working-directory: mine
- name: Push to repository
run: |
TS_VERSION=$( "${{ runner.workspace }}/tree-sitter" --version )
MONOREPO_VERSION=$( cd ../monorepo ; git log -n 1 --pretty=format:%H -- editors/tree-sitter-slint/grammar.js )
git config --global user.name "slint tree-sitter bot"
git config --global user.email "none@users.noreply.github.com"
git add -A && git commit -m "Update: grammar ${MONOREPO_VERSION} using ${TS_VERSION}" && git push || true
working-directory: mine