Skip to content

Try different package name #32

Try different package name

Try different package name #32

Workflow file for this run

name: Elsa Studio 3 Packages
on:
workflow_dispatch:
push:
branches:
- main
release:
types: [ prereleased ]
env:
package_version: 3.0.0-preview.${{ github.run_number }}
nuget_feed_feedzio: 'https://f.feedz.io/elsa-workflows/elsa-3/nuget/index.json'
nuget_feed_nuget: 'https://api.nuget.org/v3/index.json'
npm_feed_feedzio: 'https://f.feedz.io/elsa-workflows/elsa-3/npm/'
npm_feed_nuget: 'https://registry.npmjs.org/'
jobs:
build:
name: Build packages
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Verify commit exists in origin/main
run: |
git fetch --no-tags --prune --depth=1 origin +refs/heads/*:refs/remotes/origin/*
git branch --remote --contains | grep origin/main
- name: Set VERSION variable
run: echo "VERSION=${{env.package_version}}" >> $GITHUB_ENV
- name: Build workflow designer client assets
working-directory: ./src/modules/Elsa.Studio.Workflows.Designer/ClientLib
run: |
npm install --force
npm run build
- name: Build packages
run: dotnet build Elsa.Studio.sln --configuration Release /p:Version=${VERSION}
- name: Test
run: dotnet test Elsa.Studio.sln --configuration Release /p:Version=${VERSION} --no-build
- name: Pack packages
run: dotnet pack Elsa.Studio.sln --configuration Release /p:Version=${VERSION} /p:PackageOutputPath=$(pwd)/packages/nuget
- name: Publish Custom Elements packages # This generates client assets that we then package as an NPM package.
run: |
dotnet publish ./src/hosts/Elsa.Studio.Host.CustomElements --configuration Release -o ./packages/wasm /p:Version=${VERSION}
- name: Prepare npm package
run: |
cp ./packages/wasm/npm/package.json ./packages/wasm/wwwroot/package.json # Copy the package.json file from the NPM package to the wwwroot folder.
cd ./packages/wasm/wwwroot
npm version $VERSION --allow-same-version
npm pack
- name: Upload nuget artifacts
uses: actions/upload-artifact@v3
with:
name: elsa-studio-nuget-packages
path: ./packages/nuget/*nupkg
if: ${{ github.event_name == 'release' || github.event_name == 'push'}}
- name: Upload npm artifacts
uses: actions/upload-artifact@v3
with:
name: elsa-studio-npm-packages
path: ./packages/wasm/wwwroot/*.tgz
if: ${{ github.event_name == 'release' || github.event_name == 'push'}}
publish_npm_preview_feedzio:
name: Publish npm packages to feedz.io
needs: build
runs-on: ubuntu-latest
timeout-minutes: 10
if: ${{ github.event_name == 'release' || github.event_name == 'push'}}
steps:
- name: Download Packages
uses: actions/download-artifact@v3
with:
name: elsa-studio-npm-packages
- uses: actions/setup-node@v3
with:
node-version: 18.12.1
registry-url: '${{ env.npm_feed_feedzio }}'
scope: ''
always-auth: 'true'
- run: npm publish *.tgz
env:
NODE_AUTH_TOKEN: ${{ secrets.FEEDZ_API_KEY }}
# publish_nuget_preview_feedzio:
# name: Publish nuget packages to feedz.io
# needs: build_nuget_packages
# runs-on: ubuntu-latest
# timeout-minutes: 10
# if: ${{ github.event_name == 'release' || github.event_name == 'push'}}
# steps:
# - name: Download Packages
# uses: actions/download-artifact@v3
# with:
# name: elsa-studio-nuget-packages
#
# - name: Publish to feedz.io
# run: dotnet nuget push *.nupkg -k ${{ secrets.FEEDZ_API_KEY }} -s ${{ env.feedz_feed_source }} --skip-duplicate
#
# publish_nuget_preview_nuget:
# name: Publish to nuget.org
# needs: build_nuget_packages
# runs-on: ubuntu-latest
# timeout-minutes: 10
# if: ${{ github.event_name == 'release' || github.event_name == 'prereleased' }}
# steps:
# - name: Download Packages
# uses: actions/download-artifact@v3
# with:
# name: elsa-studio-nuget-packages
#
# - name: Publish to nuget.org
# run: dotnet nuget push *.nupkg -k ${{ secrets.NUGET_API_KEY }} -s ${{ env.nuget_feed_nuget }} --skip-duplicate