Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds jobs for publishing npm packages #121

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 the npm package to publish'
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'
1 change: 1 addition & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
name: Run Tests
on:
push:
branches:
Expand Down
40 changes: 0 additions & 40 deletions .github/workflows/publish-cypher-codemirror.yaml

This file was deleted.

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

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

# Run the workflow on push only after the unit tests have passed
workflow_run:
workflows: ['Run Tests']
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 }}