2929 - name : Setup .NET
3030 uses : actions/setup-dotnet@v4
3131 with :
32- dotnet-version : ' 8.0.x'
32+ dotnet-version : ' 8.0.x'
33+
34+ - name : Authenticate GitHub Packages
35+ run : |
36+ dotnet nuget remove source githubanddone --configfile src/AndDoneSecureClientLibrary/nuget.config
37+ dotnet nuget add source \
38+ --username ${{ github.repository_owner }} \
39+ --password ${{ secrets.CLIENT_LIBRARY_NUGET_AUTH_TOKEN }} \
40+ --store-password-in-clear-text \
41+ --name githubanddone \
42+ --configfile src/AndDoneSecureClientLibrary/nuget.config \
43+ "https://nuget.pkg.github.com/AndDone-LLC/index.json"
3344
3445 - name : Restore dependencies
3546 run : dotnet restore
@@ -43,22 +54,11 @@ jobs:
4354 - name : Pack
4455 run : dotnet pack --configuration Release --no-build --output ./nupkg /p:RepositoryUrl=https://github.com/anddone-kit/AndDone-SecureAPI-ClientLibrary-DotNet.git
4556
46- # Publish to the AndDone-kit account's GitHub Packages
4757 - name : Push to GitHub Packages (Public)
48- env :
49- PUBLIC_OWNER : ${{ secrets.PUBLIC_REPO && contains(secrets.PUBLIC_REPO, '/') && '' || '' }}
5058 run : |
51- # Extract the owner from PUBLIC_REPO (owner/repo-name)
52- PUBLIC_OWNER=$(echo "${{ secrets.PUBLIC_REPO }}" | cut -d'/' -f1)
53-
54- dotnet nuget add source \
55- --username "$PUBLIC_OWNER" \
56- --password ${{ secrets.CLIENT_LIBRARY_NUGET_AUTH_TOKEN }} \
57- --store-password-in-clear-text \
58- --name github-public \
59- "https://nuget.pkg.github.com/$PUBLIC_OWNER/index.json"
59+ PUBLIC_OWNER=$(echo "${{ vars.PUBLIC_REPO }}" | cut -d'/' -f1)
6060
6161 dotnet nuget push ./nupkg/*.nupkg \
6262 --api-key ${{ secrets.CLIENT_LIBRARY_NUGET_AUTH_TOKEN }} \
63- --source github-public \
63+ --source "https://nuget.pkg. github.com/$PUBLIC_OWNER/index.json" \
6464 --skip-duplicate
0 commit comments