Skip to content

Commit 75fe394

Browse files
committed
Add CI pipeline and related files
Add `build.yaml` to be run as GitHub Action and files that are needed to execute it.
1 parent 751f2b5 commit 75fe394

File tree

10 files changed

+623
-3
lines changed

10 files changed

+623
-3
lines changed

.build/BuildToolkit.ps1

Lines changed: 454 additions & 0 deletions
Large diffs are not rendered by default.

.build/Common.props

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<Project>
2+
3+
<PropertyGroup>
4+
<AssemblyVersion>0.0.0</AssemblyVersion>
5+
<AssemblyVersion Condition="'$(MORYX_ASSEMBLY_VERSION)'!=''">$(MORYX_ASSEMBLY_VERSION)</AssemblyVersion>
6+
7+
<FileVersion>0.0.0.0</FileVersion>
8+
<FileVersion Condition="'$(MORYX_FILE_VERSION)'!=''">$(MORYX_FILE_VERSION)</FileVersion>
9+
10+
<InformationalVersion>0.0.0.0</InformationalVersion>
11+
<InformationalVersion Condition="'$(MORYX_INFORMATIONAL_VERSION)'!=''">$(MORYX_INFORMATIONAL_VERSION)</InformationalVersion>
12+
13+
<PackageVersion>0.0.0</PackageVersion>
14+
<PackageVersion Condition="'$(MORYX_PACKAGE_VERSION)'!=''">$(MORYX_PACKAGE_VERSION)</PackageVersion>
15+
16+
<Authors>PHOENIXCONTACT</Authors>
17+
<Company>PHOENIX CONTACT</Company>
18+
<Product>MORYX</Product>
19+
20+
<CurrentYear>$([System.DateTime]::Now.ToString("yyyy"))</CurrentYear>
21+
<Copyright>Copyright © PHOENIX CONTACT $(CurrentYear)</Copyright>
22+
23+
<PackageIcon>moryx-logo.png</PackageIcon>
24+
<PackageProjectUrl>https://moryx-industry.net/</PackageProjectUrl>
25+
</PropertyGroup>
26+
27+
<ItemGroup>
28+
<None Include="$(MSBuildThisFileDirectory)\moryx-logo.png" Pack="true" PackagePath=""/>
29+
</ItemGroup>
30+
31+
</Project>

.build/Global.DotSettings

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation" />

.build/Output.ps1

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
################################
2+
# Functions for Console Output #
3+
################################
4+
5+
function Write-Step([string]$step) {
6+
Write-Host "########################################################################################################" -foreground Magenta;
7+
Write-Host "#### $step" -foreground Magenta;
8+
Write-Host "########################################################################################################" -foreground Magenta
9+
}
10+
11+
function Write-Variable ([string]$variableName, [string]$variableValue) {
12+
Write-Host ($variableName + " = " + $variableValue)
13+
}
14+
15+
function Invoke-ExitCodeCheck([string]$exitCode) {
16+
if ([int]::Parse($exitCode) -gt 0) {
17+
Write-Host "This is the end, you know (ExitCode: $exitCode) - Lady, the plans we had went all wrong - We ain't nothing but fight and shout and tears." -ForegroundColor Red
18+
exit $exitCode;
19+
}
20+
}
21+
22+
function Write-Host-Info([string]$message) {
23+
Write-Host $message
24+
}
25+
26+
function Write-Host-Success([string]$message) {
27+
Write-Host $message -ForegroundColor Green
28+
}
29+
30+
function Write-Host-Warning([string]$message) {
31+
Write-Host $message -ForegroundColor Yellow
32+
}
33+
34+
function Write-Host-Error([string]$message) {
35+
Write-Host $message -ForegroundColor Red
36+
}

.build/moryx-logo.png

8.2 KB
Loading

.github/workflows/build.yaml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: CI
2+
3+
# Controls when the action will run. Triggers the workflow on push or pull request
4+
on:
5+
push:
6+
branches:
7+
- main
8+
- future
9+
tags:
10+
- v[0-9]+.[0-9]+.[0-9]+ # Matches all semantic versioning tags with major, minor, patch
11+
pull_request:
12+
branches:
13+
- dev
14+
- future
15+
16+
env:
17+
dotnet_sdk_version: '8.0.100-preview.5.23303.2'
18+
REPOSITORY_NAME: ${{ github.event.repository.name }}
19+
MORYX_PACKAGE_TARGET_DEV: 'https://www.myget.org/F/moryx/api/v2/package'
20+
MORYX_PACKAGE_TARGET_V3_DEV: 'https://www.myget.org/F/moryx/api/v3/index.json'
21+
MORYX_PACKAGE_TARGET_FUTURE: 'https://www.myget.org/F/moryx-future/api/v2/package'
22+
MORYX_PACKAGE_TARGET_V3_FUTURE: 'https://www.myget.org/F/moryx-future/api/v3/index.json'
23+
MORYX_PACKAGE_TARGET_RELEASE: 'https://api.nuget.org/v3/index.json'
24+
MORYX_PACKAGE_TARGET_V3_RELEASE: 'https://api.nuget.org/v3/index.json'
25+
26+
jobs:
27+
SetupEnvironment:
28+
runs-on: ubuntu-latest
29+
steps:
30+
- run: echo ""
31+
outputs:
32+
dotnet_sdk_version: ${{ env.dotnet_sdk_version }}
33+
REPOSITORY_NAME: ${{ env.REPOSITORY_NAME }}
34+
MORYX_PACKAGE_TARGET: ${{ env.MORYX_PACKAGE_TARGET_DEV }}
35+
MORYX_PACKAGE_TARGET_V3: ${{ env.MORYX_PACKAGE_TARGET_V3_DEV }}
36+
37+
Build:
38+
needs: [SetupEnvironment]
39+
uses: moryx-industry/tools/.github/workflows/build-tool.yml@main
40+
with:
41+
dotnet_sdk_version: ${{ needs.SetupEnvironment.outputs.dotnet_sdk_version }}
42+
REPOSITORY_NAME: ${{ needs.SetupEnvironment.outputs.REPOSITORY_NAME }}
43+
SETUP_NODE: false
44+
45+
UnitTests:
46+
needs: [SetupEnvironment, Build]
47+
uses: moryx-industry/tools/.github/workflows/unittest-tool.yml@main
48+
with:
49+
dotnet_sdk_version: ${{ needs.SetupEnvironment.outputs.dotnet_sdk_version }}
50+
REPOSITORY_NAME: ${{ needs.SetupEnvironment.outputs.REPOSITORY_NAME }}
51+
52+
Publish:
53+
needs: [SetupEnvironment, UnitTests]
54+
uses: moryx-industry/tools/.github/workflows/publish-tool.yml@main
55+
with:
56+
dotnet_sdk_version: ${{ needs.SetupEnvironment.outputs.dotnet_sdk_version }}
57+
REPOSITORY_NAME: ${{ needs.SetupEnvironment.outputs.REPOSITORY_NAME }}
58+
MORYX_PACKAGE_TARGET: ${{ needs.SetupEnvironment.outputs.MORYX_PACKAGE_TARGET }}
59+
MORYX_PACKAGE_TARGET_V3: ${{ needs.SetupEnvironment.outputs.MORYX_PACKAGE_TARGET_V3 }}
60+
secrets:
61+
MYGET_TOKEN: ${{secrets.MYGET_TOKEN}}
62+
NUGET_TOKEN: ${{secrets.NUGET_TOKEN}}

Build.ps1

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
param (
2+
[switch]$Build,
3+
[switch]$Licensing,
4+
[switch]$Pack
5+
)
6+
7+
# Load Toolkit
8+
. ".build\BuildToolkit.ps1"
9+
10+
# Set MSBuild to latest version
11+
$MsBuildVersion = "latest";
12+
13+
# Initialize Toolkit
14+
Invoke-Initialize -Version (Get-Content "VERSION");
15+
16+
if ($Build) {
17+
Invoke-Build ".\Moryx.Cli.sln"
18+
}
19+
20+
if ($Licensing) {
21+
Invoke-Licensing
22+
}
23+
24+
if ($Pack) {
25+
Invoke-PackAll -Symbols
26+
}
27+
28+
Write-Host "Success!"

Moryx.Cli.sln

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Moryx.Cli.Tests", "src\Mory
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("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "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.Template", "src\Moryx.Cli.Template\Moryx.Cli.Template.csproj", "{FDE96997-1492-4FC1-AE66-E7F76A7B8374}"
1313
EndProject
14-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Moryx.Cli.Config", "src\Moryx.Cli.Config\Moryx.Cli.Config.csproj", "{F6E69A2A-F183-4A01-8629-CEBBB0417ED6}"
14+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Moryx.Cli.Config", "src\Moryx.Cli.Config\Moryx.Cli.Config.csproj", "{F6E69A2A-F183-4A01-8629-CEBBB0417ED6}"
1515
EndProject
1616
Global
1717
GlobalSection(SolutionConfigurationPlatforms) = preSolution

README.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
__ __ ___ ____ __ __ __ __ ____ _ ___ __
2+
| \/ | / _ \ | _ \ \ \ / / \ \/ / / ___| | | |_ _| _ \ \
3+
| |\/| | | | | | | |_) | \ V / \ / | | | | | | (_) | |
4+
| | | | | |_| | | _ < | | / \ _ | |___ | |___ | | _ | |
5+
|_| |_| \___/ |_| \_\ |_| /_/\_\ (_) \____| |_____| |___| (_) | |
6+
/_/
7+
18
# MORYX.CLI
29

310
## `new`
@@ -39,4 +46,4 @@ This is rather a workaround.
3946

4047
### Examples
4148

42-
moryx exec create-dbs
49+
moryx exec create-dbs

VERSION

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
0.1.0

0 commit comments

Comments
 (0)