diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0c06bc7..f50dd75 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,43 +1,43 @@ name: CI on: - pull_request: - branches: - - '**' - push: - branches: - - 'main' + pull_request: + branches: + - '**' + push: + branches: + - 'main' concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true jobs: - test: - name: Run validation tests - runs-on: ${{ matrix.os }} - strategy: - fail-fast: true - matrix: - os: [macos-latest, ubuntu-latest, windows-latest] - steps: - - name: Checkout repository - uses: actions/checkout@v3 + test: + name: Run validation tests + runs-on: ${{ matrix.os }} + strategy: + fail-fast: true + matrix: + os: [macos-latest, ubuntu-latest, windows-latest] + steps: + - name: Checkout repository + uses: actions/checkout@v3 - - name: Install Node.js - uses: actions/setup-node@v3 - with: - node-version: 16 + - name: Install Node.js + uses: actions/setup-node@v3 + with: + node-version: 16 - - name: Install dependencies - run: npm install + - name: Install dependencies + run: npm install - - name: Run tree-sitter tests - run: npm test + - name: Run tree-sitter tests + run: npm test - - name: Ensure generated parser files are up-to-date - # On Windows, tree-sitter generate results in a diff, not sure why - if: runner.os != 'Windows' - run: | - git status - test -z "$(git status --porcelain)" + - name: Ensure generated parser files are up-to-date + # On Windows, tree-sitter generate results in a diff, not sure why + if: runner.os != 'Windows' + run: | + git status + test -z "$(git status --porcelain)" diff --git a/.github/workflows/npm.yml b/.github/workflows/npm.yml new file mode 100644 index 0000000..77a9b70 --- /dev/null +++ b/.github/workflows/npm.yml @@ -0,0 +1,21 @@ +name: Publish to NPM +on: + release: + types: [created] +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Setup Node + uses: actions/setup-node@v2 + with: + node-version: '18.x' + registry-url: 'https://registry.npmjs.org' + - name: Install dependencies and build 🔧 + run: npm ci && npm run build + - name: Publish package on NPM 📦 + run: npm publish + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_GBPROD_GITCOMMIT }}