Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 11 additions & 7 deletions .github/workflows/Nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ jobs:

${{ steps.release_drafter.outputs.body }}
run: |
# .NET Core MSBuild cannot parse , and ; correctly so we replace them with substitutions: https://github.com/dotnet/msbuild/issues/471#issuecomment-366268743
# PowerShell string replacement
# .NET Core MSBuild cannot parse , and ; correctly so we replace them with MSBuild XML escapes: https://github.com/dotnet/msbuild/issues/471#issuecomment-366268743
$env:RELEASE_NOTES = $env:RELEASE_NOTES -replace ',','%2C' -replace ';','%3B'

dotnet workload restore
dotnet build -c Release # CSharpMath.VectSharp isn't tested so we need to build everything here for NuGet packages instead of relying on auto-build by dotnet test.
dotnet test --solution CSharpMath.sln -c Release -p:PackageReleaseNotes="$env:RELEASE_NOTES" -p:PackageVersion=${{ steps.release_drafter.outputs.tag_name || format('{0}-pr', github.event.number) }}-ci-${{ github.sha }}
#### Awaiting coverlet.MTP at https://github.com/coverlet-coverage/coverlet/pull/1788
# # --collect:"XPlat Code Coverage" means collect test coverage with https://github.com/coverlet-coverage/coverlet
Expand Down Expand Up @@ -72,12 +72,16 @@ jobs:
if: always()
with:
name: NuGet packages
path: .nupkgs/
path: .nupkgs/*
include-hidden-files: true # This GitHub Action interprets any file or folder starting with . as hidden and omitted by default.
- name: Push CI artifacts to GitHub Packages registry
if: github.ref == 'refs/heads/master'
run: |
# On Windows, / will not be interpreted as the folder separator in this command and \ must be used here, unlike in Unix environments.
# "dotnet nuget push" with "dotnet nuget add source" to GitHub Packages is unstable for project names with a dot: https://github.com/NuGet/Home/issues/9775#issuecomment-714509211
# So we must specify api-key directly in "dotnet nuget push" instead of following the GitHub Packages documentation
# --no-symbols true to not let GitHub Releases interpret .snupkg as .nupkg
dotnet nuget push '.nupkgs\*.nupkg' --source 'https://nuget.pkg.github.com/verybadcat/index.json' --api-key ${{ github.token }} --skip-duplicate --no-symbols true
shell: pwsh
# so we must specify -k (key) directly in "dotnet nuget push" instead of following the GitHub Packages documentation.
# By using *.* as the file path, this command will fail when .nupkgs folder contains any file that isn't a .nupkg or .snupkg file.
# --skip-duplicate enables re-running this workflow even if some packages from the same commit are already uploaded.
# --no-symbols omits uploading .snupkg files which is not supported by GitHub Packages: https://github.com/orgs/community/discussions/38678
dotnet nuget push '.nupkgs\*.*' -s 'https://nuget.pkg.github.com/verybadcat/index.json' -k ${{ github.token }} --skip-duplicate --no-symbols
shell: pwsh
13 changes: 7 additions & 6 deletions .github/workflows/Release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,11 @@ jobs:

${{ github.event.release.body }}
run: |
# .NET Core MSBuild cannot parse , and ; correctly so we replace them with substitutions: https://github.com/dotnet/msbuild/issues/471#issuecomment-366268743
# PowerShell string replacement
# .NET Core MSBuild cannot parse , and ; correctly so we replace them with MSBuild XML escapes: https://github.com/dotnet/msbuild/issues/471#issuecomment-366268743
$env:RELEASE_NOTES = $env:RELEASE_NOTES -replace ',','%2C' -replace ';','%3B'

dotnet workload restore
# -r for restore
dotnet msbuild -r -p:Configuration=Release -p:PackageVersion="${{ github.event.release.tag_name }}" -p:PackageReleaseNotes="$env:RELEASE_NOTES" CSharpMath.sln
dotnet build -c Release -p:PackageVersion="${{ github.event.release.tag_name }}" -p:PackageReleaseNotes="$env:RELEASE_NOTES" CSharpMath.sln
shell: pwsh
- name: Upload to GitHub Releases
uses: svenstaro/upload-release-action@v2
Expand All @@ -39,6 +37,9 @@ jobs:
overwrite: true
- name: Upload to NuGet
run: |
# Use --skip-duplicate since we want re-runs of this workflow to succeed in case of network issues
dotnet nuget push '.nupkgs\*.nupkg' -k ${{ secrets.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json --skip-duplicate
# On Windows, / will not be interpreted as the folder separator in this command and \ must be used here, unlike in Unix environments.
# "dotnet nuget push" with "dotnet nuget add source" to GitHub Packages is unstable for project names with a dot: https://github.com/NuGet/Home/issues/9775#issuecomment-714509211
# so we must specify -k (key) directly in "dotnet nuget push" instead of following the GitHub Packages documentation.
# --skip-duplicate enables re-running this workflow even if some packages from the same commit are already uploaded.
dotnet nuget push '.nupkgs\*.nupkg' -s 'https://api.nuget.org/v3/index.json' -k ${{ secrets.NUGET_API_KEY }} --skip-duplicate
shell: pwsh
Loading