diff --git a/.github/workflows/CD.yml b/.github/workflows/CD.yml index dc063c6..3a25c83 100644 --- a/.github/workflows/CD.yml +++ b/.github/workflows/CD.yml @@ -88,10 +88,21 @@ jobs: - name: Setup .NET Core uses: actions/setup-dotnet@v4 + # Authenticate with GitHub Packages using the GITHUB_TOKEN secret + - name: Authenticate with GitHub Packages + run: dotnet nuget add source https://nuget.pkg.github.com/hootanht/index.json -n github -u ${{ github.actor }} -p ${{ secrets.GITHUB_TOKEN }} --store-password-in-clear-text + + # Publish all NuGet packages to GitHub Packages + - name: Publish NuGet package to GitHub Packages + run: | + foreach($file in (Get-ChildItem "${{ env.NuGetDirectory }}" -Recurse -Include *.nupkg)) { + dotnet nuget push $file --api-key "${{ secrets.GITHUB_TOKEN }}" --source https://nuget.pkg.github.com/hootanht/index.json --skip-duplicate + } + # Publish all NuGet packages to NuGet.org # Use --skip-duplicate to prevent errors if a package with the same version already exists. # If you retry a failed workflow, already published packages will be skipped without error. - - name: Publish NuGet package + - name: Publish NuGet package to NuGet.org run: | foreach($file in (Get-ChildItem "${{ env.NuGetDirectory }}" -Recurse -Include *.nupkg)) { dotnet nuget push $file --api-key "${{ secrets.NUGET_APIKEY }}" --source https://api.nuget.org/v3/index.json --skip-duplicate diff --git a/PersianDate/PersianDate.csproj b/PersianDate/PersianDate.csproj index 1222ebb..e11a6ec 100644 --- a/PersianDate/PersianDate.csproj +++ b/PersianDate/PersianDate.csproj @@ -16,11 +16,11 @@ en-US https://github.com/hootanht/PrsianDate 1.0.5 - https://github.com/hootanht/PrsianDate + https://github.com/hootanht/PersianDate git disable enable - https://api.nuget.org/v3/index.json + https://nuget.pkg.github.com/hootanht/index.json nuget true true