Skip to content

Commit

Permalink
chore: Add GitHub Actions workflow for publishing to NuGet (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
patatoa committed May 11, 2024
1 parent fc78f00 commit 4946165
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Publish to NuGet

on:
release:
types: [published]
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest

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

- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 8.0.x

- name: Restore dependencies
run: dotnet restore netsuite-rest-csharp.csproj

- name: Build
run: dotnet build --no-restore --configuration Release netsuite-rest-csharp.csproj

- name: Pack
run: dotnet pack --no-build --output . netsuite-rest-csharp.csproj

- name: Push to NuGet
uses: rohith/publish-nuget@v2
with:
PROJECT_FILE_PATH: netsuite-rest-csharp.csproj
NUGET_KEY: ${{secrets.NUGET_API_KEY}}
3 changes: 3 additions & 0 deletions netsuite-rest-csharp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<PackageId>patatoa.netsuite-rest-csharp</PackageId>
<Authors>patatoa@gmail.com</Authors>
<RepositoryUrl>https://github.com/patatoa/netsuite-rest-csharp</RepositoryUrl>
</PropertyGroup>

<ItemGroup>
Expand Down

0 comments on commit 4946165

Please sign in to comment.