* Add conditional index triggers in workflow populator The trigger indexing in the workflow populator is now conditional. A boolean parameter has been added to the PopulateStoreAsync and AddAsync methods to determine whether to index triggers or not. Additionally, some code cleanups and refactoring have been made for efficient and cleaner code. * Update method call in DefaultWorkflowRegistry The method `AddAsync` in `DefaultWorkflowRegistry` has been updated to include a new first parameter set to true. This change aligns with recent modifications to the `AddAsync` method signature, ensuring proper function execution. * Add new branch triggers to GitHub workflow The updated GitHub workflow now includes triggers for branches with 'feat/*', 'enh/*', 'perf/*', 'hotfix/*', and 'chore/*' prefixes. This is to ensure that the workflow runs not only for the main, feature, issue, bug, enhancement, patch, and fix branches, but also on all new branches, improving coverage and visibility on all changes. * Add FindByIdAsync method to WorkflowInstanceManager This commit introduces a new method, FindByIdAsync, to the WorkflowInstanceManager service. This method fetches a WorkflowInstance using its Id. Also, an interface declaration for the new method is added to IWorkflowInstanceManager. * Refactor workflow definitions and add indexTriggers parameter The code for creating workflow definition filters has been refactored for brevity. Additionally, two sets of overloaded methods named `PopulateStoreAsync` and `AddAsync` were added to "IWorkflowDefinitionStorePopulator" and implemented in "DefaultWorkflowDefinitionStorePopulator". These methods allow specifying whether triggers should be indexed. * Refactor WorkflowDefinitionActivity code The refactoring is focused on an improved way of finding and passing ActivityDescriptor within WorkflowDefinitionActivity class. Previously, the service provider was passed to the DeclareInputAsVariables and DeclareOutputAsVariables methods, leading to a less readable and harder to maintain code. Now, we pass the ActivityDescriptor directly, making the code easier to understand and modify. * Update PolymorphicObjectConverter exception handling Fixes have been applied to the PolymorphicObjectConverter by adding the handling of TargetException. Additionally, the System.Reflection namespace has been included, and the addSetMethod invocation for the HashSet has been streamlined for better readability and performance. * Remove unnecessary whitespace in PersistWorkflowExecutionLogMiddleware This change simply removes an unneeded line of whitespace in the corresponding Middleware file. This change is consistent with the goal of maintaining clean and easy-to-read code. * Refactor MassTransitWorkflowDispatcher and add new methods Systematic refactor of the MassTransitWorkflowDispatcher class which initially focused on restructuring the DispatchAsync methods. New methods have been added that deal specifically with triggering and bookmarking workflows thus enhancing the readability of the code while also improving its autonomous function. The logging for non-found workflows has been improved as well. * Update event handler names in Workflow cache eviction Evicting the cache prior to triggers being indexed fixes a bug where publishing workflow changes would not result in new triggers being found. * Update Async calls and mark obsolete messages The commit adjusts calls to AddAsync in DefaultWorkflowRegistry and DispatchAsync in DefaultWorkflowInbox to improve readability. Also, it marks DispatchResumeWorkflows and DispatchTriggerWorkflows in the Elsa.MassTransit.Messages namespace as obsolete, indicating their pending removal in future releases. * Refactor workflow dispatch code to a separate method The changes remove duplication and improve readability by extracting the code responsible for dispatching a workflow into a separate method called DispatchWorkflowAsync. This method creates a workflow instance, gets the send endpoint, and then sends the message. * Refactor exception handling in PolymorphicObjectConverter This commit simplifies the two separate catch blocks for NotSupportedException and TargetException into a single block using the new 'or' pattern in C#. It also makes minor adjustments to improve the clarity and readability of the code relating to the 'addSetMethod' invocation. * Update src/modules/Elsa.MassTransit/Services/MassTransitWorkflowDispatcher.cs Co-authored-by: raymonddenhaan <155616759+raymonddenhaan@users.noreply.github.com> * Fix an attempt to dispatch bookmark ID instead of workflow instance ID The MassTransitWorkflowDispatcher.cs file is updated to improve readability and clarity. This includes changing the way bookmark and trigger filter objects are initialized, by breaking down the single-line initialization into multiple lines. Additionally, some logic has been updated in the DispatchBookmarksAsync function for better handling of workflow instance properties and input merging. * Add logging to SendHttpRequestBase The SendHttpRequestBase activity in the Elsa.Http module is updated to utilize the ILogger service. This extension enables the capture of HttpRequestException and TaskCanceledException events and logs their warnings, providing insight into potential issues during HTTP request sending. --------- Co-authored-by: raymonddenhaan <155616759+raymonddenhaan@users.noreply.github.com>
120 lines
4.4 KiB
YAML
120 lines
4.4 KiB
YAML
name: Elsa 3 Packages
|
|
on:
|
|
workflow_dispatch:
|
|
push:
|
|
branches:
|
|
- 'main'
|
|
- 'feature/*'
|
|
- 'feat/*'
|
|
- 'issue/*'
|
|
- 'bug/*'
|
|
- 'enhancement/*'
|
|
- 'enh/*'
|
|
- 'patch/*'
|
|
- 'fix/*'
|
|
- 'perf/*'
|
|
- 'hotfix/*'
|
|
- 'chore/*'
|
|
release:
|
|
types: [ prereleased, published ]
|
|
env:
|
|
feedz_feed_source: 'https://f.feedz.io/elsa-workflows/elsa-3/nuget/index.json'
|
|
nuget_feed_source: 'https://api.nuget.org/v3/index.json'
|
|
|
|
jobs:
|
|
build:
|
|
name: Build packages
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 30
|
|
steps:
|
|
- name: Extract branch name
|
|
run: |
|
|
BRANCH_NAME=${{ github.ref }} # e.g., refs/heads/main
|
|
BRANCH_NAME=${BRANCH_NAME#refs/heads/} # remove the refs/heads/ prefix
|
|
# Extract the last part after the last slash of the branch name, if any, e.g., feature/issue-123 -> issue-123 and use it as the version prefix.
|
|
PACKAGE_PREFIX=$(echo $BRANCH_NAME | rev | cut -d/ -f1 | rev | tr '_' '-')
|
|
|
|
# If the branch name is main, use the preview version. Otherwise, use the branch name as the version prefix.
|
|
if [[ "${BRANCH_NAME}" == "main" ]]; then
|
|
PACKAGE_PREFIX="preview"
|
|
fi
|
|
|
|
echo "Ref: ${{ github.ref }}"
|
|
echo "Branch name: ${BRANCH_NAME}"
|
|
echo "Package prefix: ${PACKAGE_PREFIX}"
|
|
echo "BRANCH_NAME=${BRANCH_NAME}" >> $GITHUB_ENV
|
|
echo "PACKAGE_PREFIX=${PACKAGE_PREFIX}" >> $GITHUB_ENV
|
|
- name: Checkout
|
|
uses: actions/checkout@v3
|
|
- name: Verify commit exists in branch
|
|
run: |
|
|
if [[ "${{ github.ref }}" == refs/tags/* && "${{ github.event_name }}" == "release" && "${{ github.event.action }}" == "published" ]]; then
|
|
git fetch --no-tags --prune --depth=1 origin +refs/heads/*:refs/remotes/origin/*
|
|
git branch --remote --contains | grep origin/patch/3.1.2
|
|
else
|
|
git fetch --no-tags --prune --depth=1 origin +refs/heads/*:refs/remotes/origin/*
|
|
git branch --remote --contains | grep origin/${BRANCH_NAME}
|
|
fi
|
|
- name: Set VERSION variable
|
|
run: |
|
|
if [[ "${{ github.ref }}" == refs/tags/* && "${{ github.event_name }}" == "release" && "${{ github.event.action }}" == "published" ]]; then
|
|
TAG_NAME=${{ github.ref }} # e.g., refs/tags/3.0.0
|
|
TAG_NAME=${TAG_NAME#refs/tags/} # remove the refs/tags/ prefix
|
|
echo "VERSION=${TAG_NAME}" >> $GITHUB_ENV
|
|
else
|
|
echo "VERSION=3.2.0-${PACKAGE_PREFIX}.${{github.run_number}}" >> $GITHUB_ENV
|
|
fi
|
|
- name: Compile+Test+Pack
|
|
run: ./build.sh Compile+Test+Pack --version ${VERSION}
|
|
- name: Upload artifact
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: elsa-nuget-packages
|
|
path: packages/*nupkg
|
|
if: ${{ github.event_name == 'release' || github.event_name == 'push'}}
|
|
|
|
publish_preview_feedz:
|
|
name: Publish 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-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_preview_nuget:
|
|
name: Publish preview to nuget.org
|
|
needs: build
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 10
|
|
if: ${{ github.event_name == 'prereleased' && github.event.action == 'published' }}
|
|
steps:
|
|
- name: Download Packages
|
|
uses: actions/download-artifact@v3
|
|
with:
|
|
name: elsa-nuget-packages
|
|
|
|
- name: Publish to nuget.org
|
|
run: dotnet nuget push *.nupkg -k ${{ secrets.NUGET_API_KEY }} -s ${{ env.nuget_feed_source }} --skip-duplicate
|
|
|
|
publish_nuget:
|
|
name: Publish release to nuget.org
|
|
needs: build
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 10
|
|
if: ${{ github.event_name == 'release' && github.event.action == 'published' }}
|
|
steps:
|
|
- name: Download Packages
|
|
uses: actions/download-artifact@v3
|
|
with:
|
|
name: elsa-nuget-packages
|
|
|
|
- name: Publish to nuget.org
|
|
run: dotnet nuget push *.nupkg -k ${{ secrets.NUGET_API_KEY }} -s ${{ env.nuget_feed_source }} --skip-duplicate
|