Skip to content

Feature/publish ci (#86) #78

Feature/publish ci (#86)

Feature/publish ci (#86) #78

Workflow file for this run

name: Chat Widget
on:
push:
branches: main
pull_request:
workflow_dispatch:
inputs:
version:
required: true
type: choice
description: Increment ChatWidget NPM version
default: 'patch'
options:
- patch
- minor
- major
jobs:
build:
runs-on: ubuntu-22.04
steps:
- name: Checkout repository
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
with:
ref: ${{ github.head_ref }}
- name: Setup Node version
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b
with:
node-version-file: '.nvmrc'
- name: Install dependencies
run: npm ci
- name: Lerna - Lint check
run: npm run lint
- name: Lerna - Build
run: npm run build
- name: Lerna - Tests
run: npm run test
- name: E2E - Install dependencies
run: npm run e2e:install
- name: E2E - Run automation suite
run: npm run e2e:run
- name: Authenticate with private NPM package
if: ${{ github.event_name == 'workflow_dispatch' }}
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc
- name: NPM Publish ChatWidget
if: ${{ github.event_name == 'workflow_dispatch' }}
# `--force-publish` flag keeps versions consistent across our packages. Totally wild name for this kind of a flag :shrug:
run: |
git config --global user.email "[email protected]"
git config --global user.name "RasaHQ ChatWidget"
npx lerna publish ${{ inputs.version }} --yes --force-publish