Skip to content

Commit

Permalink
Merge pull request #18 from hootanht/add-github-packages
Browse files Browse the repository at this point in the history
Add GitHub Packages support
  • Loading branch information
hootanht authored Sep 12, 2024
2 parents fc205ba + 550734b commit 2347498
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
13 changes: 12 additions & 1 deletion .github/workflows/CD.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions PersianDate/PersianDate.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@
<NeutralLanguage>en-US</NeutralLanguage>
<PackageProjectUrl>https://github.com/hootanht/PrsianDate</PackageProjectUrl>
<Version>1.0.5</Version>
<RepositoryUrl>https://github.com/hootanht/PrsianDate</RepositoryUrl>
<RepositoryUrl>https://github.com/hootanht/PersianDate</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<ImplicitUsings>disable</ImplicitUsings>
<Nullable>enable</Nullable>
<PackageSource>https://api.nuget.org/v3/index.json</PackageSource>
<PackageSource>https://nuget.pkg.github.com/hootanht/index.json</PackageSource>
<PublishProfile>nuget</PublishProfile>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<IncludeSymbols>true</IncludeSymbols>
Expand Down

0 comments on commit 2347498

Please sign in to comment.