Skip to content

Commit cd5be4a

Browse files
authored
Fix NuGet for real (#153)
* Fix NuGet for real * Update Release.yml * Include Avalonia in updating to prerelease * Update Release.yml * Update CSharpMath.Evaluation.csproj * Update Test.yml * Update Test.cs * Update Test.yml * Update test image
1 parent 337d493 commit cd5be4a

File tree

5 files changed

+31
-8
lines changed

5 files changed

+31
-8
lines changed

.github/workflows/Release.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,11 @@ jobs:
5151
file_glob: true
5252
overwrite: true
5353
- name: Upload to NuGet
54-
run: dotnet nuget push .nupkgs/ -k ${{ secrets.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json
55-
# If .nupkgs/* is used instead of .nupkg/ as the path, then not all files will be uploaded
56-
# So CSharpMath.0.5.0-alpha.nupkg and CSharpMath.0.5.0-alpha.snupkg will be uploaded but not others e.g. CSharpMath.Rendering.0.5.0-alpha.nupkg
54+
run: |
55+
for x in `ls .nupkgs/*.nupkg`
56+
do
57+
# Use --skip-duplicate since we want re-runs of this workflow to succeed in case of network issues
58+
dotnet nuget push $x -k ${{ secrets.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json --skip-duplicate
59+
done
60+
# Following command does not work... https://github.com/NuGet/Home/issues/9867
61+
# dotnet nuget push .nupkgs/ -k ${{ secrets.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json --skip-duplicate

.github/workflows/Test.yml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
dotnet tool install -g dotnet-outdated
2323
update() {
2424
dotnet outdated -u CSharpMath.Xaml.Tests.NuGet
25-
dotnet outdated -pre Always -inc CSharpMath -u CSharpMath.Xaml.Tests.NuGet
25+
dotnet outdated -pre Always -inc CSharpMath -inc Avalonia -u CSharpMath.Xaml.Tests.NuGet
2626
}
2727
# retry 5 times since dotnet outdated fails often: https://github.com/jerriep/dotnet-outdated/issues/299
2828
update || update || update || update || update
@@ -64,6 +64,12 @@ jobs:
6464
with:
6565
name: CSharpMath.Rendering.Tests results
6666
path: CSharpMath.Rendering.Tests/*/*.png
67+
- name: Upload CSharpMath.Xaml.Tests.NuGet results as CI artifacts
68+
uses: actions/upload-artifact@v2
69+
if: always()
70+
with:
71+
name: CSharpMath.Xaml.Tests.NuGet results
72+
path: CSharpMath.Xaml.Tests.NuGet/*.png
6773
- name: Upload NuGet packages as CI artifacts
6874
uses: actions/upload-artifact@v2
6975
if: always()
@@ -75,7 +81,13 @@ jobs:
7581
run: |
7682
# Non-Windows platforms require --store-password-in-clear-text: https://github.com/NuGet/Home/issues/1851
7783
dotnet nuget add source https://nuget.pkg.github.com/verybadcat/index.json -n github -u verybadcat -p ${{ secrets.GITHUB_TOKEN }} --store-password-in-clear-text
78-
dotnet nuget push .nupkgs/*.nupkg --source "github" --skip-duplicate # Don't let GitHub Releases interpret .snupkg as .nupkg
84+
for x in `ls .nupkgs/*.nupkg` # Don't let GitHub Releases interpret .snupkg as .nupkg
85+
do
86+
# Use --skip-duplicate since we want re-runs of this workflow to succeed in case of network issues
87+
dotnet nuget push $x --source "github" --skip-duplicate
88+
done
89+
# Following command does not work... https://github.com/NuGet/Home/issues/9867
90+
# dotnet nuget push .nupkgs/*.nupkg --source "github" --skip-duplicate # Don't let GitHub Releases interpret .snupkg as .nupkg
7991
Ios:
8092
runs-on: macos-latest
8193
steps:

CSharpMath.Evaluation/CSharpMath.Evaluation.csproj

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,17 @@
33
<PropertyGroup>
44
<OutputType>Library</OutputType>
55
<TargetFramework>netstandard2.0</TargetFramework>
6+
<Description>
7+
Can convert CSharpMath.Atom.MathList parsed from LaTeX with CSharpMath.Atom.LaTeXParser
8+
into actual mathematical expressions that are evaluatable with AngouriMath.
9+
Supports arithmetic, trigonometry, symbolic simplification and expansion,
10+
as well as matrices, sets, and equation solving.
11+
</Description>
612
</PropertyGroup>
713

814
<ItemGroup>
915
<ProjectReference Include="..\CSharpMath\CSharpMath.csproj" />
1016
<PackageReference Include="AngouriMath" Version="1.1.0.3-beta" />
1117
</ItemGroup>
1218

13-
</Project>
19+
</Project>

CSharpMath.Xaml.Tests.NuGet/Test.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ public void TestImage() {
1616
new Avalonia.MathView { LaTeX = "1", FontSize = 50 }.Painter.DrawAsPng(avalonia);
1717

1818
using (var forms = System.IO.File.OpenRead(File(nameof(Forms))))
19-
Xunit.Assert.Contains(forms.Length, new[] { 344L, 797 }); // 797 on Mac, 344 on Ubuntu
19+
Xunit.Assert.Equal(292, forms.Length);
2020
using (var avalonia = System.IO.File.OpenRead(File(nameof(Avalonia))))
21-
Xunit.Assert.Equal(344, avalonia.Length);
21+
Xunit.Assert.Equal(292, avalonia.Length);
2222
}
2323
}
2424
}

CSharpMath.Xaml.Tests.NuGet/Test.png

-505 Bytes
Loading

0 commit comments

Comments
 (0)