Skip to content

Commit ffa0156

Browse files
authored
Version test (#86)
* remove GitVersion.msbuild * Remove gitversion.msbuiild * Test version build * fix sonar build * Fix typo * Only list nugets * Trying skip pre-reqs * update java * add artifact script * try update build for artifact * fix script * fix typo * minor fix * fix codefactor warnings
1 parent c81a066 commit ffa0156

File tree

21 files changed

+55
-137
lines changed

21 files changed

+55
-137
lines changed

.github/workflows/build.yml

Lines changed: 26 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,17 @@ jobs:
2121
with:
2222
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
2323

24-
# Needed for sonar analysis
25-
- name: Set up JDK 11
26-
uses: actions/setup-java@v1
27-
with:
28-
java-version: 1.11
24+
# if trying to build locally, make sure you have dotnet 3.1, 5.0 installed
25+
# this container should have them pre-installed
2926

30-
# Needed for gitversion tools
31-
- name: 'Setup .NET Core SDK 3.1'
32-
uses: actions/setup-dotnet@v1
27+
# Needed for sonar analysis, even though java is installed
28+
# sonar will not pick up version 11, so state specifically
29+
# adopt is in tool cache so install should be quidker with it.
30+
- name: Set up JDK 11
31+
uses: actions/setup-java@v2
3332
with:
34-
dotnet-version: '3.1.x'
33+
distribution: 'adopt-hotspot' # Cached java
34+
java-version: '11'
3535

3636
# Install GitVersion
3737
# Requires .NET Core 3.1
@@ -47,11 +47,6 @@ jobs:
4747
with:
4848
useConfigFile: true
4949

50-
- name: Setup .NET
51-
uses: actions/setup-dotnet@v1
52-
with:
53-
dotnet-version: 5.0.x
54-
5550
- name: Setup MSBuild
5651
uses: microsoft/setup-msbuild@v1
5752

@@ -97,7 +92,15 @@ jobs:
9792
9893
# projects uses GitVersion.MsBuild, so don't neeed to pass version
9994
- name: Build
100-
run: dotnet build ${{env.solution}} --configuration ${{env.buildConfiguration}} --no-restore
95+
run: >
96+
dotnet build ${{env.solution}}
97+
--configuration ${{env.buildConfiguration}} --no-restore
98+
-p:Version=${{steps.gitversion.outputs.FullSemVer}}
99+
-p:FileVersion=${{steps.gitversion.outputs.AssemblySemFileVer}}
100+
-p:InformationalVersion=${{steps.gitversion.outputs.InformationalVersion}}
101+
102+
- name: Create Artifacts
103+
run: pwsh -command ".\CreateArtifacts.ps1"
101104

102105
- name: Test
103106
run: dotnet test ${{env.solution}} --collect:"XPlat Code Coverage" --settings coverlet.runsettings
@@ -107,4 +110,11 @@ jobs:
107110
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} # Needed to get PR information, if any
108111
SONAR_TOKEN: ${{secrets.SONAR_TOKEN}}
109112
shell: powershell
110-
run: .\.sonar\scanner\dotnet-sonarscanner end /d:sonar.login="${{secrets.SONAR_TOKEN}}"
113+
run: .\.sonar\scanner\dotnet-sonarscanner end /d:sonar.login="${{secrets.SONAR_TOKEN}}"
114+
115+
- name: Upload Artifact
116+
uses: actions/upload-artifact@v2
117+
with:
118+
name: MinoriEditorShell
119+
path: Artifacts/*.7z
120+
if-no-files-found: error

CreateArtifacts.ps1

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Get list of all nupkgs
2+
$nupkgs = Get-ChildItem -Path .\Modules -Filter *.nupkg -Recurse
3+
4+
$basedir = 'MinoriEditorSystem-' + $env:GitVersion_NuGetVersion
5+
6+
# Move each item into artifacts
7+
rm Artifacts -Recurse -Force
8+
mkdir Artifacts\$basedir\Nugets
9+
10+
# Copy nugets to nuget folder
11+
foreach ($nupkg in $nupkgs) {
12+
$leaf = Split-Path $nupkg -Leaf
13+
$outFile = "Artifacts\$basedir\Nugets\$leaf"
14+
echo $nupkg.FullName ' -> ' $outFile
15+
Copy-Item $nupkg.FullName $outFile
16+
}
17+
18+
# Copy Demo Folder
19+
#mkdir Artifacts\$basedir\Demos
20+
cp Demos\SimpleDemo\SimpleDemo.WPF\bin\Release\net5.0-windows Artifacts\$basedir\Demos\SimpleDemo.WPF -Recurse
21+
cp Demos\SimpleDemo\SimpleDemo.RibbonWPF\bin\Release\net5.0-windows Artifacts\$basedir\Demos\SimpleDemo.RibbonWPF -Recurse
22+
cp Demos\MinoriDemo\MinoriDemo.WPF\bin\Release\net5.0-windows Artifacts\$basedir\Demos\MinoriDemo.WPF -Recurse
23+
cp Demos\MinoriDemo\MinoriDemo.RibbonWPF\bin\Release\net5.0-windows Artifacts\$basedir\Demos\MinoriDemo.RibbonWPF -Recurse
24+
25+
# Compress folder into 7z file
26+
cd Artifacts
27+
7z a "$basedir.7z" $basedir
28+
cd ..

Demos/MinoriDemo/MinoriDemo.Core/MinoriDemo.Core.csproj

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,6 @@
1616
</ItemGroup>
1717

1818
<ItemGroup>
19-
<PackageReference Include="GitVersion.MsBuild" Version="5.6.11">
20-
<PrivateAssets>all</PrivateAssets>
21-
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
22-
</PackageReference>
2319
<PackageReference Include="MvvmCross" Version="8.0.2" />
2420
<PackageReference Include="MvvmCross.Plugin.Messenger" Version="8.0.2" />
2521
<PackageReference Include="System.Drawing.Common" Version="5.0.2" />

Demos/MinoriDemo/MinoriDemo.RibbonWPF/MinoriDemo.RibbonWPF.csproj

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,6 @@
55
<TargetFramework>net5.0-windows</TargetFramework>
66
<UseWPF>true</UseWPF>
77
<CodeAnalysisRuleSet>MinoriDemo.RibbonWpf.ruleset</CodeAnalysisRuleSet>
8-
9-
<!-- https://github.com/dotnet/sdk/issues/1450 -->
10-
<GenerateAssemblyFileVersionAttribute>false</GenerateAssemblyFileVersionAttribute>
11-
<GenerateAssemblyInformationalVersionAttribute>false</GenerateAssemblyInformationalVersionAttribute>
12-
<GenerateAssemblyVersionAttribute>false</GenerateAssemblyVersionAttribute>
138
</PropertyGroup>
149

1510
<ItemGroup>
@@ -22,10 +17,6 @@
2217

2318
<ItemGroup>
2419
<PackageReference Include="Dirkster.ColorPickerLib" Version="1.6.2" />
25-
<PackageReference Include="GitVersion.MsBuild" Version="5.6.11">
26-
<PrivateAssets>all</PrivateAssets>
27-
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
28-
</PackageReference>
2920
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="5.0.0" />
3021
</ItemGroup>
3122

Demos/MinoriDemo/MinoriDemo.RibbonWpf/MinoriDemo.RibbonWpf.csproj

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,6 @@
55
<TargetFramework>net5.0-windows</TargetFramework>
66
<UseWPF>true</UseWPF>
77
<CodeAnalysisRuleSet>MinoriDemo.RibbonWpf.ruleset</CodeAnalysisRuleSet>
8-
9-
<!-- https://github.com/dotnet/sdk/issues/1450 -->
10-
<GenerateAssemblyFileVersionAttribute>false</GenerateAssemblyFileVersionAttribute>
11-
<GenerateAssemblyInformationalVersionAttribute>false</GenerateAssemblyInformationalVersionAttribute>
12-
<GenerateAssemblyVersionAttribute>false</GenerateAssemblyVersionAttribute>
138
</PropertyGroup>
149

1510
<ItemGroup>
@@ -22,10 +17,6 @@
2217

2318
<ItemGroup>
2419
<PackageReference Include="Dirkster.ColorPickerLib" Version="1.6.2" />
25-
<PackageReference Include="GitVersion.MsBuild" Version="5.6.11">
26-
<PrivateAssets>all</PrivateAssets>
27-
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
28-
</PackageReference>
2920
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="5.0.0" />
3021
</ItemGroup>
3122

Demos/MinoriDemo/MinoriDemo.WPF/MinoriDemo.WPF.csproj

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,13 @@
55
<TargetFramework>net5.0-windows</TargetFramework>
66
<UseWPF>true</UseWPF>
77
<CodeAnalysisRuleSet>MinoriDemo.Wpf.ruleset</CodeAnalysisRuleSet>
8-
9-
<!-- https://github.com/dotnet/sdk/issues/1450 -->
10-
<GenerateAssemblyFileVersionAttribute>false</GenerateAssemblyFileVersionAttribute>
11-
<GenerateAssemblyInformationalVersionAttribute>false</GenerateAssemblyInformationalVersionAttribute>
12-
<GenerateAssemblyVersionAttribute>false</GenerateAssemblyVersionAttribute>
138
</PropertyGroup>
149

1510
<ItemGroup>
1611
<AdditionalFiles Include="..\..\..\.sonarlint\torisankitsune_minorieditorshell\CSharp\SonarLint.xml" Link="SonarLint.xml" />
1712
</ItemGroup>
1813

1914
<ItemGroup>
20-
<PackageReference Include="GitVersion.MsBuild" Version="5.6.11">
21-
<PrivateAssets>all</PrivateAssets>
22-
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
23-
</PackageReference>
2415
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="5.0.0" />
2516
</ItemGroup>
2617

Demos/MinoriDemo/MinoriDemo.Wpf/MinoriDemo.Wpf.csproj

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,13 @@
55
<TargetFramework>net5.0-windows</TargetFramework>
66
<UseWPF>true</UseWPF>
77
<CodeAnalysisRuleSet>MinoriDemo.Wpf.ruleset</CodeAnalysisRuleSet>
8-
9-
<!-- https://github.com/dotnet/sdk/issues/1450 -->
10-
<GenerateAssemblyFileVersionAttribute>false</GenerateAssemblyFileVersionAttribute>
11-
<GenerateAssemblyInformationalVersionAttribute>false</GenerateAssemblyInformationalVersionAttribute>
12-
<GenerateAssemblyVersionAttribute>false</GenerateAssemblyVersionAttribute>
138
</PropertyGroup>
149

1510
<ItemGroup>
1611
<AdditionalFiles Include="..\..\..\.sonarlint\torisankitsune_minorieditorshell\CSharp\SonarLint.xml" Link="SonarLint.xml" />
1712
</ItemGroup>
1813

1914
<ItemGroup>
20-
<PackageReference Include="GitVersion.MsBuild" Version="5.6.11">
21-
<PrivateAssets>all</PrivateAssets>
22-
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
23-
</PackageReference>
2415
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="5.0.0" />
2516
</ItemGroup>
2617

Demos/SimpleDemo/SimpleDemo.Core/SimpleDemo.Core.csproj

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,13 @@
33
<PropertyGroup>
44
<TargetFramework>netstandard2.0</TargetFramework>
55
<CodeAnalysisRuleSet>SimpleDemo.Core.ruleset</CodeAnalysisRuleSet>
6-
<GenerateAssemblyFileVersionAttribute>false</GenerateAssemblyFileVersionAttribute>
7-
<GenerateAssemblyInformationalVersionAttribute>false</GenerateAssemblyInformationalVersionAttribute>
8-
<GenerateAssemblyVersionAttribute>false</GenerateAssemblyVersionAttribute>
96
</PropertyGroup>
107

118
<ItemGroup>
129
<AdditionalFiles Include="..\..\..\.sonarlint\torisankitsune_minorieditorshell\CSharp\SonarLint.xml" Link="SonarLint.xml" />
1310
</ItemGroup>
1411

1512
<ItemGroup>
16-
<PackageReference Include="GitVersion.MsBuild" Version="5.6.11">
17-
<PrivateAssets>all</PrivateAssets>
18-
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
19-
</PackageReference>
2013
<PackageReference Include="MvvmCross" Version="8.0.2" />
2114
<PackageReference Include="MvvmCross.Plugin.Messenger" Version="8.0.2" />
2215
</ItemGroup>

Demos/SimpleDemo/SimpleDemo.RibbonWPF/SimpleDemo.RibbonWPF.csproj

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,6 @@
1212
</ItemGroup>
1313

1414
<ItemGroup>
15-
<PackageReference Include="GitVersion.MsBuild" Version="5.6.11">
16-
<PrivateAssets>all</PrivateAssets>
17-
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
18-
</PackageReference>
1915
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="5.0.0" />
2016
</ItemGroup>
2117

Demos/SimpleDemo/SimpleDemo.RibbonWpf/SimpleDemo.RibbonWpf.csproj

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,6 @@
1212
</ItemGroup>
1313

1414
<ItemGroup>
15-
<PackageReference Include="GitVersion.MsBuild" Version="5.6.11">
16-
<PrivateAssets>all</PrivateAssets>
17-
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
18-
</PackageReference>
1915
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="5.0.0" />
2016
</ItemGroup>
2117

0 commit comments

Comments
 (0)