Skip to content

Commit

Permalink
Modernnize nuget.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
maximn committed Oct 8, 2024
1 parent 6185614 commit 8da5ad1
Showing 1 changed file with 9 additions and 22 deletions.
31 changes: 9 additions & 22 deletions .github/workflows/nuget.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,44 +3,31 @@ name: Publish Nuget
on:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
push:
tags:
- 'v*'

jobs:
publish:
# The type of runner that the job will run on
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Setup .NET
uses: actions/setup-dotnet@v1
uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.0.x
dotnet-version: '7.0.x'

- name: Restore dependencies
run: dotnet restore

- name: Build
run: dotnet build --configuration Release --no-restore


- name: List Files
run: ls -la GoogleMapsApi
- name: Pack
run: dotnet pack --configuration Release --no-build --output .

- name: Publish NuGet
# You may pin to the exact commit or the version.
# uses: brandedoutcast/publish-nuget@c12b8546b67672ee38ac87bea491ac94a587f7cc
uses: brandedoutcast/[email protected]
with:
# Filepath of the project to be packaged, relative to root of repository
PROJECT_FILE_PATH: GoogleMapsApi/GoogleMapsApi.csproj
# NuGet package id, used for version detection & defaults to project name
PACKAGE_NAME: GoogleMapsApi
# Filepath with version info, relative to root of repository & defaults to PROJECT_FILE_PATH
#VERSION_FILE_PATH: # optional
#VERSION_REGEX: # optional, default is ^\s*<Version>(.*)<\/Version>\s*$
#VERSION_STATIC: 1.0.1 #Taken from Project File.
NUGET_KEY: ${{secrets.NUGET_API_KEY}}
# NuGet server uri hosting the packages, defaults to https://api.nuget.org
#NUGET_SOURCE: # optional, default is https://api.nuget.org

run: dotnet nuget push *.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json

0 comments on commit 8da5ad1

Please sign in to comment.