Skip to content

Commit

Permalink
chore: update readme & workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
ObserverOfTime committed Feb 12, 2024
1 parent f682b3a commit 3d03b37
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 66 deletions.
44 changes: 16 additions & 28 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,22 @@ name: Test grammar

on:
push:
branches: [master]
branches: ["*"]
paths:
- grammar.js
- src/**
- bindings/**
- binding.gyp
pull_request:
branches: [master]
branches: ["*"]
paths:
- grammar.js
- src/**
- bindings/**
- binding.gyp

jobs:
node:
name: Test Node library
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
name: Checkout repository
- uses: actions/setup-node@v4
name: Set up NodeJS
with:
node-version: 20
- name: Install dependencies
run: npm install
- name: Run tests
run: npm test
rust:
name: Test Rust library
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: stable
- name: Run tests
run: cargo test
test:
uses: tree-sitter-grammars/.github/.github/workflows/ci.yml@main
with:
test-library: true
47 changes: 9 additions & 38 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,43 +2,14 @@ name: Publish package

on:
push:
tags: ['*']
tags: ["*"]

jobs:
node:
name: Publish Node package
runs-on: ubuntu-latest
environment:
name: npm
url: https://www.npmjs.com/package/tree-sitter-gitattributes
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up NodeJS
uses: actions/setup-node@v4
with:
node-version: 20
registry-url: https://registry.npmjs.org/
- name: Install packages
run: npm install
- name: Publish to NPM
run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
rust:
name: Publish Rust package
runs-on: ubuntu-latest
environment:
name: crates
url: https://crates.io/crates/tree-sitter-gitattributes
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: stable
- name: Publish to crates.io
run: cargo publish
env:
CARGO_REGISTRY_TOKEN: ${{secrets.CARGO_TOKEN}}
npm:
uses: tree-sitter-grammars/.github/.github/workflows/package-npm.yml@main
secrets:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
crates:
uses: tree-sitter-grammars/.github/.github/workflows/package-crates.yml@main
secrets:
CARGO_REGISTRY_TOKEN: ${{secrets.CARGO_TOKEN}}
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
[![CI][ci]](https://github.com/tree-sitter-grammars/tree-sitter-gitattributes/actions/workflows/ci.yml)
[![discord][discord]](https://discord.gg/w7nTvsVJhm)
[![matrix][matrix]](https://matrix.to/#/#nvim-treesitter:matrix.org)
[![npm][npm]](https://www.npmjs.com/package/tree-sitter-gitattributes)
[![crates][crates]](https://crates.io/crates/tree-sitter-gitattributes)

A tree-sitter parser for `.gitattributes` files.

Expand All @@ -25,3 +27,5 @@ A tree-sitter parser for `.gitattributes` files.
[ci]: https://img.shields.io/github/actions/workflow/status/tree-sitter-grammars/tree-sitter-gitattributes/ci.yml?logo=github&label=CI
[discord]: https://img.shields.io/discord/1063097320771698699?logo=discord&label=tree-sitter
[matrix]: https://img.shields.io/matrix/nvim-treesitter%3Amatrix.org?logo=matrix&label=nvim-treesitter
[npm]: https://img.shields.io/npm/v/tree-sitter-gitattributes?logo=npm
[crates]: https://img.shields.io/crates/v/tree-sitter-gitattributes?logo=rust

0 comments on commit 3d03b37

Please sign in to comment.