Skip to content

Commit 89696e3

Browse files
authored
Fix GitHub Packages (#157)
* Fix GitHub Packages * Grammar * Update Test.yml
1 parent b4cf331 commit 89696e3

File tree

1 file changed

+18
-10
lines changed

1 file changed

+18
-10
lines changed

.github/workflows/Test.yml

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -88,16 +88,24 @@ jobs:
8888
- name: Push CI artifacts to GitHub Packages registry
8989
if: github.ref == 'refs/heads/master'
9090
run: |
91-
# Non-Windows platforms require --store-password-in-clear-text: https://github.com/NuGet/Home/issues/1851
92-
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
93-
for x in `ls .nupkgs/*.nupkg` # Don't let GitHub Releases interpret .snupkg as .nupkg
94-
do
95-
# The GitHub Package registry does not support .snupkg files so we specify --no-symbols
96-
# Use --skip-duplicate since we want re-runs of this workflow to succeed in case of network issues
97-
dotnet nuget push $x --no-symbols --source "github" --skip-duplicate
98-
done
99-
# Following command does not work... https://github.com/NuGet/Home/issues/9867
100-
# dotnet nuget push .nupkgs/*.nupkg --no-symbols --source "github" --skip-duplicate # Don't let GitHub Releases interpret .snupkg as .nupkg
91+
# dotnet nuget push to GitHub Packages is unstable for project names with a dot: https://github.com/NuGet/Home/issues/9775
92+
# So someone wrote a .NET Core tool to workaround this: https://github.com/NuGet/Home/issues/9775#issuecomment-660947350
93+
# Currently this tool will never return a non-0 exit code: https://github.com/jcansdale/gpr/issues/69 (nice)
94+
# But we must not include .snupkg files in globbing or a duplicate version error will occur: https://github.com/jcansdale/gpr/issues/83
95+
dotnet tool install -g gpr
96+
gpr push .nupkgs/*.nupkg -k ${{ secrets.GITHUB_TOKEN }}
97+
98+
# Original code before using this tool:
99+
# # Non-Windows platforms require --store-password-in-clear-text: https://github.com/NuGet/Home/issues/1851
100+
# 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
101+
# for x in `ls .nupkgs/*.nupkg` # Don't let GitHub Releases interpret .snupkg as .nupkg
102+
# do
103+
# # The GitHub Package registry does not support .snupkg files so we specify --no-symbols
104+
# # Use --skip-duplicate since we want re-runs of this workflow to succeed in case of network issues
105+
# dotnet nuget push $x --source "github" --skip-duplicate --no-symbols
106+
# done
107+
# # Following command does not work... https://github.com/NuGet/Home/issues/9867
108+
# # dotnet nuget push .nupkgs/*.nupkg --source "github" --skip-duplicate --no-symbols # Don't let GitHub Releases interpret .snupkg as .nupkg
101109
Ios:
102110
runs-on: macos-latest
103111
steps:

0 commit comments

Comments
 (0)