Skip to content

Commit

Permalink
Adds jobs for publishing npm packages
Browse files Browse the repository at this point in the history
  • Loading branch information
ncordon committed Oct 19, 2023
1 parent d6c654b commit 088d4c2
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 40 deletions.
28 changes: 28 additions & 0 deletions .github/actions/publish-npm/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: 'Publishes package to npm registry'

inputs:
project-name:
description: 'Name of gradle project to test'
required: true

runs:
using: 'composite'
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup antlr4
uses: ./.github/actions/setup-antlr4

- name: Install dependencies with frozen lock file and generate parser
run: npm ci

- name: Build project
run: npm run build

- name: Publish on updated version number
uses: JS-DevTools/npm-publish@v2
with:
token: ${{ secrets.NPM_TOKEN }}
package: 'packages/${{inputs.project-name}}/package.json'
access: 'public'
40 changes: 0 additions & 40 deletions .github/workflows/publish-cypher-codemirror.yaml

This file was deleted.

27 changes: 27 additions & 0 deletions .github/workflows/publish-packages.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Publish react-codemirror package to npm

on:
# Runs on pushes targeting the default branch
# push:
# branches: ['main']

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

env:
NODE_OPTIONS: '--max_old_space_size=4096'

jobs:
publish:
strategy:
fail-fast: false
matrix:
project: ['language-support', 'language-server', 'react-codemirror']

environment: publish-npm
runs-on: ubuntu-latest
steps:
- name: Publish ${{ matrix.project }} to npm
uses: ./.github/actions/publish-npm
with:
project-name: ${{ matrix.project }}

0 comments on commit 088d4c2

Please sign in to comment.