Skip to content

Commit adf879c

Browse files
committed
chore: updates workflows (#35)
1 parent 04dcb2c commit adf879c

File tree

9 files changed

+117
-93
lines changed

9 files changed

+117
-93
lines changed

.github/workflows/ci.yml

Lines changed: 33 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,40 @@
11
name: CI
22

33
on:
4-
pull_request:
5-
branches:
6-
- '**'
7-
push:
8-
branches:
9-
- 'main'
4+
pull_request:
5+
branches:
6+
- '**'
7+
push:
8+
branches:
9+
- 'main'
1010

1111
concurrency:
12-
group: ${{ github.workflow }}-${{ github.ref }}
13-
cancel-in-progress: true
12+
group: ${{ github.workflow }}-${{ github.ref }}
13+
cancel-in-progress: true
1414

1515
jobs:
16-
test:
17-
name: Run validation tests
18-
runs-on: ${{ matrix.os }}
19-
strategy:
20-
fail-fast: true
21-
matrix:
22-
os: [macos-latest, ubuntu-latest, windows-latest]
23-
steps:
24-
- name: Checkout repository
25-
uses: actions/checkout@v3
26-
27-
- name: Install Node.js
28-
uses: actions/setup-node@v3
29-
with:
30-
node-version: 16
31-
32-
- name: Install dependencies
33-
run: npm install
34-
35-
- name: Run tree-sitter tests
36-
run: npm test
37-
38-
- name: Ensure generated parser files are up-to-date
39-
# On Windows, tree-sitter generate results in a diff, not sure why
40-
if: runner.os != 'Windows'
41-
run: |
42-
git status
43-
test -z "$(git status --porcelain)"
16+
test:
17+
name: Run validation tests
18+
runs-on: ${{ matrix.os }}
19+
strategy:
20+
fail-fast: true
21+
matrix:
22+
os: [macos-latest, ubuntu-latest, windows-latest]
23+
steps:
24+
- name: Checkout repository
25+
uses: actions/checkout@v3
26+
- name: Install Node.js
27+
uses: actions/setup-node@v3
28+
with:
29+
node-version: '18.x'
30+
registry-url: 'https://registry.npmjs.org'
31+
- name: Install dependencies
32+
run: npm ci
33+
- name: Run tree-sitter tests
34+
run: npm test
35+
- name: Ensure generated parser files are up-to-date
36+
# On Windows, tree-sitter generate results in a diff, not sure why
37+
if: runner.os != 'Windows'
38+
run: |
39+
git status
40+
test -z "$(git status --porcelain)"

.github/workflows/crates.yml

Lines changed: 0 additions & 21 deletions
This file was deleted.

.github/workflows/npm.yml

Lines changed: 0 additions & 23 deletions
This file was deleted.

.github/workflows/publish.yaml

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
name: Publish
2+
on:
3+
release:
4+
types: [released]
5+
workflow_dispatch:
6+
7+
jobs:
8+
bump:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout
12+
uses: actions/checkout@v3
13+
- name: Setup Node
14+
uses: actions/setup-node@v2
15+
with:
16+
node-version: '18.x'
17+
registry-url: 'https://registry.npmjs.org'
18+
- name: Update npm version
19+
run: npm version ${GITHUB_REF_NAME#v} --no-git-tag-version
20+
- name: Install stable toolchain
21+
uses: actions-rs/toolchain@v1
22+
with:
23+
profile: minimal
24+
toolchain: stable
25+
override: true
26+
- name: Install cargo bump
27+
run: cargo install cargo-bump
28+
- name: Update cargo version
29+
run: cargo bump ${GITHUB_REF_NAME#v}
30+
- uses: stefanzweifel/git-auto-commit-action@v4
31+
with:
32+
commit_message: 'chore: bump version'
33+
branch: main
34+
35+
publish_npm:
36+
runs-on: ubuntu-latest
37+
needs: bump
38+
steps:
39+
- name: Checkout
40+
uses: actions/checkout@v3
41+
with:
42+
ref: main
43+
- name: Setup Node
44+
uses: actions/setup-node@v2
45+
with:
46+
node-version: '18.x'
47+
registry-url: 'https://registry.npmjs.org'
48+
- name: Install dependencies and build 🔧
49+
run: npm ci && npm run build
50+
- name: Publish package on NPM 📦
51+
run: npm publish
52+
env:
53+
NODE_AUTH_TOKEN: ${{ secrets.NPM_GBPROD_GITCOMMIT }}
54+
55+
publish_crates:
56+
runs-on: ubuntu-latest
57+
needs: bump
58+
steps:
59+
- name: Checkout
60+
uses: actions/checkout@v3
61+
with:
62+
ref: main
63+
- name: Install stable toolchain
64+
uses: actions-rs/toolchain@v1
65+
with:
66+
profile: minimal
67+
toolchain: stable
68+
override: true
69+
- run: cargo publish --token ${CRATES_TOKEN}
70+
env:
71+
CRATES_TOKEN: ${{ secrets.CRATES_GBPROD_GITCOMMIT }}

.prettierrc

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
2-
"semi": true,
3-
"singleQuote": true,
4-
"trailingComma": "es5",
5-
"jsxBracketSameLine": true,
6-
"printWidth": 120,
7-
"arrowParens": "always",
8-
"tabWidth": 2
2+
"semi": true,
3+
"singleQuote": true,
4+
"trailingComma": "es5",
5+
"jsxBracketSameLine": true,
6+
"printWidth": 80,
7+
"arrowParens": "always",
8+
"tabWidth": 2
99
}

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "tree-sitter-gitcommit"
33
description = "gitcommit grammar for the tree-sitter parsing library"
4-
version = "0.0.1"
4+
version = "0.3.0"
55
keywords = ["incremental", "parsing", "gitcommit"]
66
categories = ["parsing", "text-editors"]
77
repository = "https://github.com/tree-sitter/tree-sitter-gitcommit"
@@ -20,7 +20,7 @@ include = [
2020
path = "bindings/rust/lib.rs"
2121

2222
[dependencies]
23-
tree-sitter = "~0.20.3"
23+
tree-sitter = ">= 0.19"
2424

2525
[build-dependencies]
2626
cc = "1.0"

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ The currently supported locales are listed below:
3535

3636
## Note about injected languages
3737

38-
This parser _only_ parse git commit subject, message and generated comments, it doesn't handle diff and git rebase informations that could be included.
38+
This parser _only_ parses git commit subject, message and generated comments, it doesn't handle diff and git rebase information that could be included.
3939
To handle that, you must have `diff` and `git_rebase` tree-sitter grammars installed and add injection queries.
4040

4141
If you're using Neovim and [`nvim-treesitter`](https://github.com/nvim-treesitter/nvim-treesitter), you just have to be sure that `diff` and `git_rebase` are installed (using `TSInstall diff git_rebase` for example).

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "tree-sitter-gitcommit",
3-
"version": "1.0.0",
3+
"version": "0.3.0",
44
"description": "A tree-sitter grammar for git commit messages",
55
"main": "bindings/node",
66
"scripts": {

0 commit comments

Comments
 (0)