Skip to content

Commit 3c54497

Browse files
committed
Merge remote-tracking branch 'github/dev'
2 parents 27bb965 + c77f0c7 commit 3c54497

File tree

98 files changed

+3731
-1317
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

98 files changed

+3731
-1317
lines changed

.build/BuildToolkit.ps1

Lines changed: 0 additions & 454 deletions
This file was deleted.

.build/Global.DotSettings

Lines changed: 0 additions & 1 deletion
This file was deleted.

.build/Output.ps1

Lines changed: 0 additions & 36 deletions
This file was deleted.
Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
name: 'Build and Publish'
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- dev
8+
- future
9+
- release/*
10+
tags:
11+
- v[0-9]+.[0-9]+.[0-9]+
12+
pull_request:
13+
branches:
14+
- dev
15+
- future
16+
- release/*
17+
18+
env:
19+
dotnet_sdk_version: '8.0.300'
20+
21+
jobs:
22+
Variables:
23+
runs-on: ubuntu-latest
24+
steps:
25+
- name: Set Release variables
26+
id: set-variables
27+
run: |
28+
if [[ ${{ github.ref_name }} =~ v[0-9]+.[0-9]+.[0-9]+ ]]; then
29+
echo "MORYX_PACKAGE_TARGET=https://www.myget.org/F/moryx/api/v2/package" >> $GITHUB_OUTPUT
30+
echo "MORYX_PACKAGE_TARGET_V3=https://www.myget.org/F/moryx/api/v3/index.json" >> $GITHUB_OUTPUT
31+
echo "NPM_PACKAGE_SOURCE=//www.myget.org/F/moryx-ci/npm/" >> $GITHUB_OUTPUT
32+
else
33+
echo "MORYX_PACKAGE_TARGET=https://www.myget.org/F/moryx-ci/api/v2/package" >> $GITHUB_OUTPUT
34+
echo "MORYX_PACKAGE_TARGET_V3=https://www.myget.org/F/moryx-ci/api/v3/index.json" >> $GITHUB_OUTPUT
35+
echo "NPM_PACKAGE_SOURCE=//www.myget.org/F/moryx-ci/npm/" >> $GITHUB_OUTPUT
36+
fi
37+
outputs:
38+
dotnet_sdk_version: ${{ env.dotnet_sdk_version }}
39+
MORYX_PACKAGE_TARGET: ${{ steps.set-variables.outputs.MORYX_PACKAGE_TARGET }}
40+
MORYX_PACKAGE_TARGET_V3: ${{ steps.set-variables.outputs.MORYX_PACKAGE_TARGET_V3 }}
41+
NPM_PACKAGE_SOURCE: ${{ steps.set-variables.outputs.NPM_PACKAGE_SOURCE }}
42+
43+
Tests:
44+
needs: [Variables]
45+
uses: moryx-industry/tools/.github/workflows/run-tests.yml@v1
46+
with:
47+
dotnet_sdk_version: ${{ needs.Variables.outputs.dotnet_sdk_version }}
48+
npm_package_source: ${{ needs.Variables.outputs.NPM_PACKAGE_SOURCE }}
49+
secrets:
50+
npm_auth_token: ${{ secrets.MYGET_TOKEN }}
51+
myget_auth_token: ${{ secrets.MYGET_TOKEN }}
52+
myget_user: ${{ secrets.MYGET_USER }}
53+
myget_pass: ${{ secrets.MYGET_PASS }}
54+
55+
56+
Build-Publish:
57+
needs: [Variables, Tests]
58+
runs-on: ubuntu-latest
59+
env:
60+
NUGET_PACKAGES: ${{ github.workspace }}/.nuget/packages
61+
MORYX_COMMERCIAL_BUILD: true
62+
steps:
63+
- uses: actions/checkout@v4
64+
65+
- uses: actions/cache@v4
66+
id: cache-nuget
67+
with:
68+
path: ${{ github.workspace }}/.nuget/packages
69+
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj') }}
70+
restore-keys: |
71+
${{ runner.os }}-nuget-
72+
73+
- name: 🔧 Setup .NET SDK
74+
uses: actions/setup-dotnet@v4
75+
with:
76+
dotnet-version: ${{ needs.Variables.outputs.dotnet_sdk_version }}
77+
78+
- name: 🧰 Setup BuildToolkit
79+
uses: moryx-industry/setup-buildtoolkit@v1
80+
81+
- name: ♺ Execute nuget restore
82+
run: dotnet restore
83+
if: steps.cache-nuget.outputs.cache-hit != 'true'
84+
85+
- name: 🔨 Execute dotnet build
86+
run: |
87+
.\set-version.ps1 -RefName ${{ github.ref_name }} -IsTag ${{ github.ref_type == 'tag' && 1 || 0 }} -BuildNumber ${{ github.run_number }} -CommitHash ${{ github.sha }}
88+
.\build.ps1 -PackageSource ${{ github.workspace }}/.nuget/packages
89+
shell: pwsh
90+
91+
- name: Copy artifacts
92+
run: cp -r artifacts/build artifacts/Licensing
93+
if: ${{ github.ref_name == 'dev' || github.ref_name == 'future' || (startsWith(github.ref, 'refs/tags/v')) }}
94+
95+
- name: 📦 Create Packages and 🚚 deliver
96+
run: |
97+
.\set-version.ps1 -RefName ${{ github.ref_name }} -IsTag ${{ github.ref_type == 'tag' && 1 || 0 }} -BuildNumber ${{ github.run_number }} -CommitHash ${{ github.sha }}
98+
.\pack-publish.ps1 -NugetApiKey ${{ secrets.MYGET_TOKEN }} -PackageTarget ${{ needs.Variables.outputs.MORYX_PACKAGE_TARGET }}
99+
shell: pwsh
100+
if: ${{ github.ref_name == 'dev' || github.ref_name == 'future' || (startsWith(github.ref, 'refs/tags/v')) }}
101+
102+
- name: ⬆️ Upload build artifacts
103+
uses: actions/upload-artifact@v4
104+
with:
105+
name: packages
106+
path: artifacts/packages/
107+
if: ${{ github.ref_name == 'dev' || github.ref_name == 'future' || (startsWith(github.ref, 'refs/tags/v')) }}
108+
109+
Create-Reports:
110+
needs: [Build-Publish]
111+
uses: moryx-industry/tools/.github/workflows/create-test-report.yml@v1
112+
if: ${{ github.ref_name == 'dev' || github.ref_name == 'future' || (startsWith(github.ref, 'refs/tags/v')) }}
113+
114+
Publish-Reports:
115+
needs: [Create-Reports]
116+
uses: moryx-industry/tools/.github/workflows/publish-test-coverage.yml@v1
117+
secrets:
118+
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
119+
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
120+

.github/workflows/build.yaml

Lines changed: 0 additions & 58 deletions
This file was deleted.

Directory.Build.targets

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project>
3+
4+
<PropertyGroup>
5+
<MicrosoftCodeAnalysisVersion>4.10.0</MicrosoftCodeAnalysisVersion>
6+
</PropertyGroup>
7+
8+
<ItemGroup>
9+
<PackageReference Update="Microsoft.CodeAnalysis.Common" Version="$(MicrosoftCodeAnalysisVersion)" />
10+
<PackageReference Update="Microsoft.CodeAnalysis.CSharp" Version="$(MicrosoftCodeAnalysisVersion)" />
11+
<PackageReference Update="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="$(MicrosoftCodeAnalysisVersion)" />
12+
<PackageReference Update="Microsoft.CodeAnalysis.Workspaces.Common" Version="$(MicrosoftCodeAnalysisVersion)" />
13+
</ItemGroup>
14+
</Project>

Moryx.Cli.sln

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,25 @@ VisualStudioVersion = 17.5.33530.505
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Moryx.Cli", "src\Moryx.Cli\Moryx.Cli.csproj", "{13F36F0F-F879-4A52-99AE-ABF895F2D375}"
77
EndProject
8-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Moryx.Cli.Tests", "src\Moryx.Cli.Tests\Moryx.Cli.Tests.csproj", "{E65D2591-A889-4F42-A6F5-AECAFB77DBB0}"
8+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Moryx.Cli.Tests", "src\Tests\Moryx.Cli.Tests\Moryx.Cli.Tests.csproj", "{E65D2591-A889-4F42-A6F5-AECAFB77DBB0}"
99
EndProject
1010
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Moryx.Cli.Commands", "src\Moryx.Cli.Commands\Moryx.Cli.Commands.csproj", "{A05301A2-A68F-40BE-8ED9-0A8DF0CECFCE}"
1111
EndProject
12-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Moryx.Cli.Template", "src\Moryx.Cli.Template\Moryx.Cli.Template.csproj", "{FDE96997-1492-4FC1-AE66-E7F76A7B8374}"
12+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Moryx.Cli.Templates", "src\Moryx.Cli.Templates\Moryx.Cli.Templates.csproj", "{FDE96997-1492-4FC1-AE66-E7F76A7B8374}"
1313
EndProject
1414
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Moryx.Cli.Config", "src\Moryx.Cli.Config\Moryx.Cli.Config.csproj", "{F6E69A2A-F183-4A01-8629-CEBBB0417ED6}"
1515
EndProject
16+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{6FC4CD2F-8BFA-4EC1-84A9-D3670BA92E4D}"
17+
EndProject
18+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SolutionItems", "SolutionItems", "{81E6FB33-4958-4022-B93B-6B82B06AEE74}"
19+
ProjectSection(SolutionItems) = preProject
20+
Directory.Build.targets = Directory.Build.targets
21+
EndProjectSection
22+
EndProject
23+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Moryx.Cli.Commands.Tests", "src\Tests\Moryx.Cli.Commands.Tests\Moryx.Cli.Commands.Tests.csproj", "{4C082129-3A6D-4A72-80DC-8A9D3A71A79F}"
24+
EndProject
25+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Moryx.Cli.Remotes", "src\Moryx.Cli.Remotes\Moryx.Cli.Remotes.csproj", "{0C42AB23-AFA3-44B5-986C-BF7991275897}"
26+
EndProject
1627
Global
1728
GlobalSection(SolutionConfigurationPlatforms) = preSolution
1829
Debug|Any CPU = Debug|Any CPU
@@ -39,10 +50,22 @@ Global
3950
{F6E69A2A-F183-4A01-8629-CEBBB0417ED6}.Debug|Any CPU.Build.0 = Debug|Any CPU
4051
{F6E69A2A-F183-4A01-8629-CEBBB0417ED6}.Release|Any CPU.ActiveCfg = Release|Any CPU
4152
{F6E69A2A-F183-4A01-8629-CEBBB0417ED6}.Release|Any CPU.Build.0 = Release|Any CPU
53+
{4C082129-3A6D-4A72-80DC-8A9D3A71A79F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
54+
{4C082129-3A6D-4A72-80DC-8A9D3A71A79F}.Debug|Any CPU.Build.0 = Debug|Any CPU
55+
{4C082129-3A6D-4A72-80DC-8A9D3A71A79F}.Release|Any CPU.ActiveCfg = Release|Any CPU
56+
{4C082129-3A6D-4A72-80DC-8A9D3A71A79F}.Release|Any CPU.Build.0 = Release|Any CPU
57+
{0C42AB23-AFA3-44B5-986C-BF7991275897}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
58+
{0C42AB23-AFA3-44B5-986C-BF7991275897}.Debug|Any CPU.Build.0 = Debug|Any CPU
59+
{0C42AB23-AFA3-44B5-986C-BF7991275897}.Release|Any CPU.ActiveCfg = Release|Any CPU
60+
{0C42AB23-AFA3-44B5-986C-BF7991275897}.Release|Any CPU.Build.0 = Release|Any CPU
4261
EndGlobalSection
4362
GlobalSection(SolutionProperties) = preSolution
4463
HideSolutionNode = FALSE
4564
EndGlobalSection
65+
GlobalSection(NestedProjects) = preSolution
66+
{E65D2591-A889-4F42-A6F5-AECAFB77DBB0} = {6FC4CD2F-8BFA-4EC1-84A9-D3670BA92E4D}
67+
{4C082129-3A6D-4A72-80DC-8A9D3A71A79F} = {6FC4CD2F-8BFA-4EC1-84A9-D3670BA92E4D}
68+
EndGlobalSection
4669
GlobalSection(ExtensibilityGlobals) = postSolution
4770
SolutionGuid = {99BD1616-551D-473A-A6DB-6A9C0F030AB7}
4871
EndGlobalSection

NuGet.Config

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<configuration>
3+
<packageRestore>
4+
<!-- Allow NuGet to download missing packages -->
5+
<add key="enabled" value="True" />
6+
7+
<!-- Automatically check for missing packages during build in Visual Studio -->
8+
<add key="automatic" value="True" />
9+
</packageRestore>
10+
11+
<packageSources>
12+
<clear />
13+
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
14+
</packageSources>
15+
</configuration>

README.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,31 @@ Adds a product 'name'
2424

2525
moryx add product <NAME>
2626

27+
28+
## `add state`
29+
30+
Adds a 'state machine' to a specified context. It adds a folder `States` next
31+
to the file that contains the context including a `StateBase` and `State` files
32+
for each provided state. The context will be updated to implement `IStateContext`.
33+
34+
Adding further states later is possible and would add the new states and update
35+
the existing `StateBase` accordingly.
36+
37+
_Note_: Adding states to the `States` folder may lead conflicts if you try to
38+
create states for several contexts that live inside the same path. We recommend
39+
to move those 'to be contexts' to separate directories or libraries before
40+
adding state machines in order to maintain a clean project structure.
41+
42+
43+
### Usage
44+
45+
moryx add states <CONTEXT> --states <Comma separated list of states>
46+
47+
Example
48+
49+
moryx add states AssemblingCell --states "Initialing, Running, Testing"
50+
51+
2752

2853
## `add step`
2954

@@ -47,3 +72,29 @@ This is rather a workaround.
4772
### Examples
4873

4974
moryx exec create-dbs
75+
76+
77+
## Remotes
78+
79+
The CLI uses Git repositories as templates in order to create new application
80+
projects or add any kind of features to it.
81+
82+
By default, this repository is `https://github.com/PHOENIXCONTACT/MORYX-Template/tree/machine`
83+
if nothing else is provided to the `moryx new` command.
84+
85+
To change or switch later, from where to retrieve templates, `remotes` were
86+
introduced to manage template sources within a project.
87+
88+
### Usage
89+
90+
moryx remotes add <NAME> <URL> <BRANCH> Adds a Git remote to the local config
91+
moryx remotes remove <NAME> Removes Git remotes
92+
moryx remotes use <NAME> Uses the given remote by default
93+
94+
### Examples
95+
96+
moryx remotes
97+
moryx remotes add custom https://example.com/repo.git main
98+
moryx remotes remove custom
99+
moryx remotes use custom
100+

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.1.2
1+
0.2.0

0 commit comments

Comments
 (0)