Skip to content

Commit fde1803

Browse files
Merge pull request #10 from thygesteffensen/feature/valuecontainer
Feature/valuecontainer
2 parents bd1021b + 3b2ca2a commit fde1803

40 files changed

+1680
-890
lines changed

.github/workflows/.releaserc

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
branches:
2+
- name: main
3+
- name: dev
4+
prerelease: alpha
5+
6+
plugins:
7+
- - "@semantic-release/commit-analyzer"
8+
- preset: conventionalcommits
9+
10+
- - "@semantic-release/release-notes-generator"
11+
- preset: conventionalcommits
12+
13+
- - "@semantic-release/github"
14+
- assets:
15+
- path: ../../artifacts/PowerAutomateMockUp.*.nupkg
16+
label: Parser DLL
17+
18+
- - "@semantic-release/exec"
19+
- publishCmd: "dotnet nuget push ..\\..\\artifacts\\PowerAutomateMockUp.*.nupkg --source https://nuget.pkg.github.com/thygesteffensen/index.json --api-key ${process.env.GITHUB_TOKEN}"
20+
21+
- - "@semantic-release/exec"
22+
- publishCmd: "dotnet nuget push ..\\..\\artifacts\\PowerAutomateMockUp.*.nupkg --source https://api.nuget.org/v3/index.json --api-key ${process.env.CI_NUGET_API_KEY}"

.github/workflows/build.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Build
2+
3+
on:
4+
push:
5+
branches: [ dev ]
6+
pull_request:
7+
types: [assigned, opened, synchronize, reopened]
8+
9+
jobs:
10+
test:
11+
runs-on: windows-latest
12+
name: Testing
13+
steps:
14+
- name: Checkout code base
15+
uses: actions/checkout@v2
16+
17+
- name: Run tests
18+
run: dotnet test --verbosity normal
19+
20+
build:
21+
runs-on: windows-latest
22+
name: Building
23+
steps:
24+
- name: Checkout code base
25+
uses: actions/checkout@v2
26+
27+
- name: Setup MSBuild
28+
uses: microsoft/setup-msbuild@v1
29+
30+
- name: Restore NuGet packages
31+
run: nuget restore PowerAutomateMockUp.sln
32+
33+
- name: Build solution
34+
run: msbuild /p:OutputPath=../build /p:Configuration=Release /p:RestorePackages=false
35+
36+
- name: Archive build to artifacts
37+
uses: actions/upload-artifact@v2
38+
with:
39+
name: build
40+
path: |
41+
build/PowerAutomateMockUp.dll
42+
retention-days: 5

.github/workflows/release.yml

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches:
6+
- dev
7+
- main
8+
9+
jobs:
10+
test:
11+
name: Testing
12+
runs-on: windows-latest
13+
steps:
14+
- name: Checkout repo
15+
uses: actions/checkout@v2
16+
17+
- name: Run tests
18+
run: dotnet test --verbosity normal
19+
20+
release:
21+
name: Releasing
22+
runs-on: windows-latest
23+
needs:
24+
- test
25+
steps:
26+
- name: Checkout repo
27+
uses: actions/checkout@v2
28+
29+
- name: Setup Node.js
30+
uses: actions/setup-node@v1
31+
with:
32+
node-version: 13
33+
34+
- name: Add plugin for conventional commits
35+
run: npm install conventional-changelog-conventionalcommits
36+
working-directory: ./.github/workflows
37+
38+
- name: Add plugin for executing bash commands
39+
run: npm install @semantic-release/exec -D
40+
working-directory: ./.github/workflows
41+
42+
- name: Dry Run Semantic to get next Version nummber
43+
working-directory: ./.github/workflows
44+
env:
45+
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
46+
GIT_AUTHOR_NAME: thygesteffensen
47+
GIT_AUTHOR_EMAIL: 31892312+thygesteffensen@users.noreply.github.com
48+
run: |
49+
echo "RELEASE_VERSION=$((npx semantic-release --dry-run).Where({ $_ -like '*Release note*' }) | Out-String | Select-String '[0-9]+\.[0-9]+\.[0-9]+([-][a-zA-z]+[.][0-9]*)' | % { $_.Matches } | % { $_.Value })" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
50+
51+
- name: Print release verison
52+
run: echo ${env:RELEASE_VERSION}
53+
54+
- name: Setup MSBuild
55+
uses: microsoft/setup-msbuild@v1
56+
57+
- name: Restore NuGet packages
58+
run: nuget restore PowerAutomateMockUp.sln
59+
60+
- name: Package Parser
61+
run: msbuild /t:pack /p:PackageVersion=${env:RELEASE_VERSION} /p:OutputPath=..\\artifacts
62+
if: ${{ env.RELEASE_VERSION }}
63+
64+
- name: Release to GitHub
65+
working-directory: .\\.github\\workflows
66+
env:
67+
CI_NUGET_API_KEY: ${{ secrets.NUGETAPIKEY }}
68+
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
69+
GIT_AUTHOR_NAME: thygesteffensen
70+
GIT_AUTHOR_EMAIL: 31892312+thygesteffensen@users.noreply.github.com
71+
run: npx semantic-release

PowerAutomateMockUp.sln

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@ EndProject
1010
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{3A832071-17C0-4F94-8592-4060E11AB731}"
1111
ProjectSection(SolutionItems) = preProject
1212
.gitignore = .gitignore
13-
readme.md = readme.md
14-
Terminology.md = Terminology.md
13+
ReadMe.md = ReadMe.md
1514
EndProjectSection
1615
EndProject
1716
Global

PowerAutomateMockUp/ExpressionParser/ExpressionEngine.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
namespace Parser.ExpressionParser
22
{
3-
public class ExpressionEngine
3+
public interface IExpressionEngine
4+
{
5+
string Parse(string input);
6+
}
7+
8+
public class ExpressionEngine : IExpressionEngine
49
{
510
private readonly ExpressionGrammar _expressionGrammar;
611

PowerAutomateMockUp/ExpressionParser/Functions/Base/FlowRunnerDependencyExtension.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public static void AddFlowRunner(this IServiceCollection services)
2222
services.AddScoped<IVariableRetriever>(x => x.GetRequiredService<IState>());
2323
services.AddScoped<IOutputsRetriever>(x => x.GetRequiredService<IState>());
2424
services.AddScoped<ITriggerOutputsRetriever>(x => x.GetRequiredService<IState>());
25-
services.AddScoped<ExpressionEngine>();
25+
services.AddScoped<IExpressionEngine, ExpressionEngine>();
2626
services.AddScoped<ExpressionGrammar>();
2727

2828
services.AddTransient<IFunction, ConcatFunction>();
@@ -36,9 +36,9 @@ public static void AddFlowRunner(this IServiceCollection services)
3636

3737
services.AddFlowActionByFlowType<IfActionExecutor>("If");
3838
services.AddFlowActionByFlowType<ScopeActionExecutor>("Scope");
39-
40-
// services.AddLogging();
39+
services.AddFlowActionByFlowType<TerminateActionExecutor>("Terminate");
4140

41+
services.AddLogging();
4242
}
4343

4444
public static void AddFlowActionByName<T>(this IServiceCollection services, string actionName)

PowerAutomateMockUp/ExpressionParser/Rules/ConstantRule.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public ValueContainer Evaluate()
1616

1717
public string PrettyPrint()
1818
{
19-
return _content.ToString();
19+
return _content.Type() == ValueContainer.ValueType.String? $"'{_content}'" : _content.ToString();
2020
}
2121
}
2222
}

0 commit comments

Comments
 (0)