Skip to content

Commit

Permalink
add workflow to publish nuget packages
Browse files Browse the repository at this point in the history
  • Loading branch information
fredyyy998 committed Apr 10, 2023
1 parent ebdbb17 commit c170fb1
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 22 deletions.
22 changes: 0 additions & 22 deletions .github/unit-test.yml

This file was deleted.

33 changes: 33 additions & 0 deletions .github/workflows/publish-packages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: NuGet Package

on:
release:
types: [created]

jobs:
build-and-publish:
name: Build and Publish
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Setup .NET Core SDK
uses: actions/setup-dotnet@v1
with:
dotnet-version: '6.0.400' # change this to match your version of .NET Core SDK

- name: Restore packages
run: dotnet restore

- name: Build package
run: dotnet pack -c Release

- name: Publish package
uses: nuget/setup-nuget@v1
with:
nuget-api-key: ${{ secrets.GITHUB_TOKEN }}
nuget-version: '6.3.0.128'
run: |
dotnet nuget push *.nupkg --skip-duplicate --api-key ${{ secrets.GITHUB_TOKEN }} --source https://nuget.pkg.github.com/fredyyy998/index.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<RepositoryUrl>https://nuget.pkg.github.com/fredyyy998/index.json</RepositoryUrl>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<Version>1.0.2</Version>
<RepositoryUrl>https://nuget.pkg.github.com/fredyyy998/index.json</RepositoryUrl>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<RepositoryUrl>https://nuget.pkg.github.com/fredyyy998/index.json</RepositoryUrl>
</PropertyGroup>

<ItemGroup>
Expand Down

0 comments on commit c170fb1

Please sign in to comment.