elsa-core/.github/workflows/npm-packages.yml
jdevillard 97d56ae47b
V3 designer/angular wrapper (#3829)
* init lerna multi repo

* move project

* add @types/node

* init angular project

* fix workspace name

* update packages init

* change level of import due to monorepo

* add angular target

* add angular loading

User components copy instead of component.ts created by the framework

* skip lib check to avoid issue with antl/x6 libraries

 type parameter might need an `extends Events.EventArgs` constraint in /node_modules/@antv/x6/lib/common/basecoat.d.ts:3:31

* fix type declaration

* change Event<Array<Type>> to Event<Type[]> to allow angular wrapper build

* add class for angular wrapper

* add angular component library -- need rename

* exclude component context-consumer

* change interface available for package

* change public method and add publishCurrentWokflow

* add angular elsa dashboard

* add angular sample

* commit package lock

* add refresh activities

* rename library package to @elsa-workflows/elsa-workflows-designer-angular-wrapper

change build to be compatible with lerna

* update README

* update github action to include lerna build

---------

Co-authored-by: Jérémie DEVILLARD <jdevillard@users.noreply.github.com>
2023-03-23 21:58:23 +01:00

106 lines
2.9 KiB
YAML

name: Elsa 3 Workflow Designer
on:
workflow_dispatch:
push:
branches:
- v3
paths:
- src/designer/elsa-workflows-designer/**
- .github/**
pull_request:
branches:
- v3
paths:
- src/designer/elsa-workflows-designer/**
- .github/**
env:
NODE_OPTIONS: --max-old-space-size=4096
ELSA_VERSION: 3.0.2
jobs:
build_and_pack:
name: Build workflow designer package
runs-on: ubuntu-latest
steps:
- name: Set preview VERSION variable
run: echo "VERSION=$ELSA_VERSION-preview.${{ github.run_number }}" >> $GITHUB_ENV
if: ${{ github.event_name != 'release' }}
- name: Set release VERSION variable
run: echo "VERSION=${{ github.ref_name }}" >> $GITHUB_ENV
if: ${{ github.event_name == 'release' }}
- name: Checkout
uses: actions/checkout@v1
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 18.12.1
cache: 'npm'
cache-dependency-path: '**/package-lock.json'
- run: echo $VERSION
- run: node --version
- run: npm --version
- name: Build Designer
working-directory: ./src/designer
run: |
npm install --force
npm version $VERSION --allow-same-version
npx lerna run build
- name: Pack Designer
working-directory: ./src/designer/designer_packages/elsa-workflows-designer
run: npm pack
if: ${{ github.event_name == 'release' || github.event_name == 'push'}}
- name: Upload Designer Artifact
uses: actions/upload-artifact@v3
with:
name: designer-npm-package
path: src/designer/designer_packages/elsa-workflows-designer/elsa-*.tgz
if: ${{ github.event_name == 'release' || github.event_name == 'push'}}
publish_npm_preview:
name: Publish preview package to feedz
needs: build_and_pack
runs-on: ubuntu-latest
if: ${{ github.event_name == 'release' || github.event_name == 'push'}}
steps:
- name: Download NPM Package
uses: actions/download-artifact@v3
with:
name: designer-npm-package
- uses: actions/setup-node@v3
with:
node-version: 18.12.1
registry-url: 'https://f.feedz.io/elsa-workflows/elsa-3/npm/'
- run: npm publish *.tgz
env:
NODE_AUTH_TOKEN: ${{ secrets.FEEDZ_IO_NPM }}
publish_npm_release:
name: Publish release package to npmjs
needs: build_and_pack
runs-on: ubuntu-latest
if: ${{ github.event_name == 'release' }}
steps:
- name: Download NPM Package
uses: actions/download-artifact@v3
with:
name: designer-npm-package
- uses: actions/setup-node@v3
with:
node-version: 18.12.1
registry-url: 'https://registry.npmjs.org'
- run: npm publish *.tgz
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}