Added github workflow to automate designer package update process (#3791)

* Updated package.json files

* Added npm pipeline for designer

* Updated Elsa.Workflows.Designer package
This commit is contained in:
gurkanguran 2023-03-14 08:07:15 +01:00 committed by GitHub
parent c1dca8fbe2
commit f7f5290d04
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 206 additions and 1857 deletions

106
.github/workflows/npm-packages.yml vendored Normal file
View file

@ -0,0 +1,106 @@
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/elsa-workflows-designer
run: |
npm install --force
npm version $VERSION --allow-same-version
npm run build
- name: Pack Designer
working-directory: ./src/designer/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/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 }}

View file

@ -1,6 +1,6 @@
{
"name": "@elsa-workflows/elsa-workflows-designer",
"version": "3.0.2-preview.64",
"version": "3.0.2",
"description": "A workflow designer for Elsa 3",
"main": "./dist/index.cjs.js",
"module": "./dist/index.js",

View file

@ -0,0 +1 @@
@elsa-workflows:registry=https://f.feedz.io/elsa-workflows/elsa-3/npm/

File diff suppressed because it is too large Load diff

View file

@ -6,7 +6,7 @@
"build:debug": "cross-env webpack --mode=development --env configuration=Debug"
},
"devDependencies": {
"@elsa-workflows/elsa-workflows-designer": "^3.0.2-preview.64",
"@elsa-workflows/elsa-workflows-designer": ">=3.0.2-preview",
"copy-webpack-plugin": "^11.0.0",
"cross-env": "^7.0.3",
"monaco-editor": "^0.34.1",