Skip to content

Commit

Permalink
Fix NuGet for real (#153)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
Happypig375 authored Aug 3, 2020
1 parent 337d493 commit cd5be4a
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 8 deletions.
11 changes: 8 additions & 3 deletions .github/workflows/Release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@ jobs:
file_glob: true
overwrite: true
- name: Upload to NuGet
run: dotnet nuget push .nupkgs/ -k ${{ secrets.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json
# If .nupkgs/* is used instead of .nupkg/ as the path, then not all files will be uploaded
# 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
run: |
for x in `ls .nupkgs/*.nupkg`
do
# Use --skip-duplicate since we want re-runs of this workflow to succeed in case of network issues
dotnet nuget push $x -k ${{ secrets.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json --skip-duplicate
done
# Following command does not work... https://github.com/NuGet/Home/issues/9867
# dotnet nuget push .nupkgs/ -k ${{ secrets.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json --skip-duplicate
16 changes: 14 additions & 2 deletions .github/workflows/Test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
dotnet tool install -g dotnet-outdated
update() {
dotnet outdated -u CSharpMath.Xaml.Tests.NuGet
dotnet outdated -pre Always -inc CSharpMath -u CSharpMath.Xaml.Tests.NuGet
dotnet outdated -pre Always -inc CSharpMath -inc Avalonia -u CSharpMath.Xaml.Tests.NuGet
}
# retry 5 times since dotnet outdated fails often: https://github.com/jerriep/dotnet-outdated/issues/299
update || update || update || update || update
Expand Down Expand Up @@ -64,6 +64,12 @@ jobs:
with:
name: CSharpMath.Rendering.Tests results
path: CSharpMath.Rendering.Tests/*/*.png
- name: Upload CSharpMath.Xaml.Tests.NuGet results as CI artifacts
uses: actions/upload-artifact@v2
if: always()
with:
name: CSharpMath.Xaml.Tests.NuGet results
path: CSharpMath.Xaml.Tests.NuGet/*.png
- name: Upload NuGet packages as CI artifacts
uses: actions/upload-artifact@v2
if: always()
Expand All @@ -75,7 +81,13 @@ jobs:
run: |
# Non-Windows platforms require --store-password-in-clear-text: https://github.com/NuGet/Home/issues/1851
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
dotnet nuget push .nupkgs/*.nupkg --source "github" --skip-duplicate # Don't let GitHub Releases interpret .snupkg as .nupkg
for x in `ls .nupkgs/*.nupkg` # Don't let GitHub Releases interpret .snupkg as .nupkg
do
# Use --skip-duplicate since we want re-runs of this workflow to succeed in case of network issues
dotnet nuget push $x --source "github" --skip-duplicate
done
# Following command does not work... https://github.com/NuGet/Home/issues/9867
# dotnet nuget push .nupkgs/*.nupkg --source "github" --skip-duplicate # Don't let GitHub Releases interpret .snupkg as .nupkg
Ios:
runs-on: macos-latest
steps:
Expand Down
8 changes: 7 additions & 1 deletion CSharpMath.Evaluation/CSharpMath.Evaluation.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,17 @@
<PropertyGroup>
<OutputType>Library</OutputType>
<TargetFramework>netstandard2.0</TargetFramework>
<Description>
Can convert CSharpMath.Atom.MathList parsed from LaTeX with CSharpMath.Atom.LaTeXParser
into actual mathematical expressions that are evaluatable with AngouriMath.
Supports arithmetic, trigonometry, symbolic simplification and expansion,
as well as matrices, sets, and equation solving.
</Description>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\CSharpMath\CSharpMath.csproj" />
<PackageReference Include="AngouriMath" Version="1.1.0.3-beta" />
</ItemGroup>

</Project>
</Project>
4 changes: 2 additions & 2 deletions CSharpMath.Xaml.Tests.NuGet/Test.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ public void TestImage() {
new Avalonia.MathView { LaTeX = "1", FontSize = 50 }.Painter.DrawAsPng(avalonia);

using (var forms = System.IO.File.OpenRead(File(nameof(Forms))))
Xunit.Assert.Contains(forms.Length, new[] { 344L, 797 }); // 797 on Mac, 344 on Ubuntu
Xunit.Assert.Equal(292, forms.Length);
using (var avalonia = System.IO.File.OpenRead(File(nameof(Avalonia))))
Xunit.Assert.Equal(344, avalonia.Length);
Xunit.Assert.Equal(292, avalonia.Length);
}
}
}
Binary file modified CSharpMath.Xaml.Tests.NuGet/Test.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit cd5be4a

Please sign in to comment.