diff --git a/.github/workflows/Release.yml b/.github/workflows/Release.yml index 3a6b326a..cd95c6eb 100644 --- a/.github/workflows/Release.yml +++ b/.github/workflows/Release.yml @@ -21,6 +21,12 @@ 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 + # https://www.gnu.org/software/bash/manual/bash.html#Shell-Parameter-Expansion + # ${parameter/pattern/string} If pattern begins with ‘/’, all matches of pattern are replaced with string. Normally only the first match is replaced. + RELEASE_NOTES=${RELEASE_NOTES//,/%2C} + RELEASE_NOTES=${RELEASE_NOTES//;/%3B} + # -r for restore dotnet msbuild -r -p:Configuration=Release -p:PackageVersion="${{ github.event.release.tag_name }}" -p:PackageReleaseNotes="$RELEASE_NOTES" CSharpMath.CrossPlatform.slnf - name: Upload to GitHub Releases @@ -34,4 +40,4 @@ jobs: - name: Upload to NuGet run: | # We use double quotes to avoid shell globbing: https://github.com/NuGet/Home/issues/4393#issuecomment-667618120 # 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 \ No newline at end of file + dotnet nuget push ".nupkgs/*.nupkg" -k ${{ secrets.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json --skip-duplicate diff --git a/.github/workflows/Test.yml b/.github/workflows/Test.yml index e3be9d7a..48ff2af7 100644 --- a/.github/workflows/Test.yml +++ b/.github/workflows/Test.yml @@ -32,8 +32,7 @@ jobs: # ${{ steps.release_drafter.outputs.name }} ${{ steps.release_drafter.outputs.body }} - # run: dotnet test - run: | # https://github.com/dotnet/sdk/issues/10409, https://github.com/dotnet/sdk/issues/11417 + run: | # .NET Core MSBuild cannot parse , and ; correctly so we replace them with substitutions: https://github.com/dotnet/msbuild/issues/471#issuecomment-366268743 # https://www.gnu.org/software/bash/manual/bash.html#Shell-Parameter-Expansion # ${parameter/pattern/string} If pattern begins with ‘/’, all matches of pattern are replaced with string. Normally only the first match is replaced. @@ -83,18 +82,11 @@ jobs: - name: Push CI artifacts to GitHub Packages registry if: github.ref == 'refs/heads/master' run: | - # dotnet nuget push to GitHub Packages is unstable for project names with a dot: https://github.com/NuGet/Home/issues/9775 - # So someone wrote a .NET Core tool to workaround this: https://github.com/NuGet/Home/issues/9775#issuecomment-660947350 - # Currently this tool will never return a non-0 exit code: https://github.com/jcansdale/gpr/issues/69 (nice) - # But we must not include .snupkg files in globbing or a duplicate version error will occur: https://github.com/jcansdale/gpr/issues/83 - dotnet tool install -g gpr - gpr push .nupkgs/*.nupkg -k ${{ secrets.GITHUB_TOKEN }} - - # Original code before using this tool: - # # 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 - # # We use double quotes to avoid shell globbing: https://github.com/NuGet/Home/issues/4393#issuecomment-667618120 - # dotnet nuget push ".nupkgs/*.nupkg" --source "github" --skip-duplicate --no-symbols # Don't let GitHub Releases interpret .snupkg as .nupkg + # "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 + # We use quotes to avoid shell globbing: https://github.com/NuGet/Home/issues/4393#issuecomment-667618120 + # --no-symbols 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 Ios: runs-on: macos-latest steps: