-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (48 loc) · 1.42 KB
/
release.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
name: Release
on:
push:
branches:
- master
jobs:
release:
name: Build release artifacts
runs-on: ubuntu-20.04
env:
REPO_NAME: ${{github.event.repository.name}}
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: 'release'
# Don't do a sparse checkout because we need to
# create and push new commits:
fetch-depth: '0'
- name: Checkout master state
run: |-
git checkout origin/master -- .
rm .gitignore
mv release.gitignore .gitignore
- name: Set up tree-sitter CLI
uses: tree-sitter/setup-action/cli@v1
with:
tree-sitter-ref: 'v0.22.6'
- name: Install parser dependencies
run: |-
JQ_SCRIPT='.dependencies | del(."node-addon-api", ."node-gyp-build") | length > 0'
if jq -e "$JQ_SCRIPT" package.json >/dev/null; then
npm i --omit dev --omit peer --omit optional
fi
- name: Generate parser
run: tree-sitter generate
- name: Run Unit-Tests
run: tree-sitter test
- name: Push to Release Branch
shell: bash
run: |-
git config user.name "GitHub Actions Bot"
git config user.email "<>"
git add --all
git commit -m "Release master at ${{ github.sha }}"
git push