Skip to content

Commit bddf4df

Browse files
authored
Upload CI artifacts (#127)
* Upload CI artifacts * Why was dotnet test whole solution invalid again? * Cross-platform solution filter * Test cross-platform * Nope... * Time test * echo correctly * echo even more correctly * Set CI signature * Bye, have a great time! * Add branch to CI signature * Invert git info and datetime * Don't output "HEAD" as GitBranch * Ooops + at the end * Fine. Branches are unobtainable. * Conditionalize AppendCISignatureToPackageVersion * No; * Space added * Push to GitHub Packages * s * Folder? * Try alternatives * Only push when master
1 parent e5312c2 commit bddf4df

File tree

4 files changed

+59
-2
lines changed

4 files changed

+59
-2
lines changed

.github/workflows/Build all projects.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,12 @@ jobs:
2424
run: nuget restore CSharpMath.sln
2525
- name: Build
2626
run: msbuild CSharpMath.sln /p:Configuration=Release
27+
- uses: actions/upload-artifact@v2
28+
with:
29+
name: NuGet packages
30+
path: .nupkgs/
31+
- name: Push generated packages to GitHub registry
32+
if: github.ref == 'refs/heads/master'
33+
run: |
34+
nuget sources add -name "GPR" -Source https://nuget.pkg.github.com/verybadcat/index.json -Username verybadcat -Password ${{ secrets.GITHUB_TOKEN }}
35+
nuget push .nupkgs/ -Source "GPR" -SkipDuplicate

.github/workflows/Test all projects.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ jobs:
2929
# retry 5 times since dotnet outdated fails often: https://github.com/jerriep/dotnet-outdated/issues/299
3030
update || update || update || update || update
3131
- name: Build and Test
32-
run: |
32+
# run: dotnet test CSharpMath.CrossPlatform.slnf
33+
run: | # https://github.com/dotnet/sdk/issues/10409, https://github.com/dotnet/sdk/issues/11417
3334
for p in\
3435
"CSharpMath.CoreTests"\
3536
"CSharpMath.Editor.Tests"\

CSharpMath.CrossPlatform.slnf

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"solution": {
3+
"path": "CSharpMath.sln",
4+
"projects": [
5+
"AngouriMath\\AngouriMath\\AngouriMath.csproj",
6+
"AngouriMath\\Tests\\UnitTests\\UnitTests.csproj",
7+
"CSharpMath.Avalonia.Example\\CSharpMath.Avalonia.Example.csproj",
8+
"CSharpMath.Avalonia\\CSharpMath.Avalonia.csproj",
9+
"CSharpMath.CoreTests\\CSharpMath.CoreTests.csproj",
10+
"CSharpMath.Editor.Tests.FSharp\\CSharpMath.Editor.Tests.FSharp.fsproj",
11+
"CSharpMath.Editor.Tests.Visualizer\\CSharpMath.Editor.Tests.Visualizer.csproj",
12+
"CSharpMath.Editor.Tests\\CSharpMath.Editor.Tests.csproj",
13+
"CSharpMath.Editor\\CSharpMath.Editor.csproj",
14+
"CSharpMath.Evaluation.Tests\\CSharpMath.Evaluation.Tests.csproj",
15+
"CSharpMath.Evaluation\\CSharpMath.Evaluation.csproj",
16+
"CSharpMath.Forms.Example\\CSharpMath.Forms.Example\\CSharpMath.Forms.Example.csproj",
17+
"CSharpMath.Forms\\CSharpMath.Forms.csproj",
18+
"CSharpMath.Playground\\CSharpMath.Playground.csproj",
19+
"CSharpMath.Rendering.Tests\\CSharpMath.Rendering.Tests.csproj",
20+
"CSharpMath.Rendering.Text.Tests\\CSharpMath.Rendering.Text.Tests.csproj",
21+
"CSharpMath.Rendering\\CSharpMath.Rendering.csproj",
22+
"CSharpMath.SkiaSharp\\CSharpMath.SkiaSharp.csproj",
23+
"CSharpMath.Wiki\\CSharpMath.Wiki.shproj",
24+
"CSharpMath.Xaml.Tests.NuGet\\CSharpMath.Xaml.Tests.NuGet.csproj",
25+
"CSharpMath.Xaml.Tests\\CSharpMath.Xaml.Tests.csproj",
26+
"CSharpMath.Xaml\\CSharpMath.Xaml.shproj",
27+
"CSharpMath\\CSharpMath.csproj",
28+
"PixelFarm.Typography (Excerpt)\\PixelFarm.Typography (Excerpt).shproj",
29+
"Typography\\Typography.GlyphLayout\\Typography.GlyphLayout.shproj",
30+
"Typography\\Typography.OpenFont\\Typography.OpenFont.shproj",
31+
"Typography\\Typography.TextBreak\\Typography.TextBreak.UnitTests\\TextBreakTests.csproj",
32+
"Typography\\Typography.TextBreak\\Typography.TextBreak\\Typography.TextBreak.shproj"
33+
]
34+
}
35+
}

Directory.Build.props

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,4 +55,16 @@
5555
And $(GeneratePackageOnBuild)">
5656
<None Include="$(MSBuildThisFileDirectory)Icon.png" Pack="true" PackagePath="" />
5757
</ItemGroup>
58-
</Project>
58+
<Target Name="AppendCISignatureToPackageVersion" BeforeTargets="BeforeBuild" Condition="
59+
$(MSBuildProjectName.StartsWith('CSharpMath'))
60+
And !$([System.String]::IsNullOrEmpty($(GeneratePackageOnBuild)))
61+
And $(GeneratePackageOnBuild)
62+
And $(CI)">
63+
<Exec Command="git rev-parse HEAD" ConsoleToMSBuild="true">
64+
<Output TaskParameter="ConsoleOutput" PropertyName="GitCommit" />
65+
</Exec>
66+
<CreateProperty Value="$(PackageVersion)-ci-$(GitCommit)+$([System.DateTime]::UtcNow.ToString('yyyy.MM.dd-HH.mm.ss'))">
67+
<Output TaskParameter="Value" PropertyName="PackageVersion" />
68+
</CreateProperty>
69+
</Target>
70+
</Project>

0 commit comments

Comments
 (0)