Skip to content

Upgraded samples and dashboard to .NET 8 (#4826) #236

Upgraded samples and dashboard to .NET 8 (#4826)

Upgraded samples and dashboard to .NET 8 (#4826) #236

name: Build and Publish Elsa Packages
on:
workflow_dispatch:
push:
branches:
- 2.x
pull_request:
branches:
- 2.x
release:
types: [published]
env:
NODE_OPTIONS: --max-old-space-size=4096
ELSA_VERSION: 2.14.0
jobs:
build_and_pack:
name: Build and Pack Elsa
runs-on: ubuntu-latest
services:
mongo:
image: mongo
ports:
- 27017:27017
postgres:
image: postgres
env:
POSTGRES_USER: root
POSTGRES_PASSWORD: Password12!
POSTGRES_DB: elsa
ports:
- 5432:5432
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-studio
run: |
npm install --force
npm version $VERSION --allow-same-version
npm run build
- name: Pack Designer
working-directory: ./src/designer/elsa-workflows-studio
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-studio/elsa-*.tgz
if: ${{ github.event_name == 'release' || github.event_name == 'push'}}
- name: Build Bindings
working-directory: ./src/designer/bindings/aspnet/Elsa.Designer.Components.Web
run: |
npm install --force
npm install -g webpack
npm install -g webpack-cli
npm run build
- name: Build Elsa
run: dotnet build --configuration Release /p:Version=$VERSION
- name: Run Tests
run: dotnet test --configuration Release --no-build --no-restore
- name: Pack Elsa
run: dotnet pack --configuration Release /p:Version=$VERSION /p:PackageOutputPath=$(pwd)/out
if: ${{ github.event_name == 'release' || github.event_name == 'push'}}
- name: Upload Elsa Artifact
uses: actions/upload-artifact@v3
with:
name: elsa-nuget-package
path: out/*nupkg
if: ${{ github.event_name == 'release' || github.event_name == 'push'}}
publish_npm_preview:
name: Publish npm (Preview)
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-2/npm/'
- run: npm publish *.tgz
env:
NODE_AUTH_TOKEN: ${{ secrets.FEEDZ_IO_NPM }}
publish_npm_release:
name: Publish to npm
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 }}
publish_nuget_preview:
name: Publish Nuget (Preview)
needs: build_and_pack
runs-on: ubuntu-latest
if: ${{ github.event_name == 'release' || github.event_name == 'push'}}
steps:
- name: Download Nuget Packages
uses: actions/download-artifact@v3
with:
name: elsa-nuget-package
- name: Publish Nuget Packages to MyGet
run: dotnet nuget push *.nupkg -k ${{ secrets.FEEDZ_API_KEY }} -s https://f.feedz.io/elsa-workflows/elsa-2/nuget/index.json --skip-duplicate
publish_nuget_release:
name: Publish to Nuget
needs: build_and_pack
runs-on: ubuntu-latest
if: ${{ github.event_name == 'release' }}
steps:
- name: Download Nuget Packages
uses: actions/download-artifact@v3
with:
name: elsa-nuget-package
- name: Publish Nuget Packages to MyGet
run: dotnet nuget push *.nupkg -k ${{ secrets.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json --skip-duplicate