Skip to content

Commit

Permalink
Merge pull request #2 from sanelli/ReleaseWorkflow
Browse files Browse the repository at this point in the history
Add script to deploy NuGet packages to nuget
  • Loading branch information
sanelli committed Jul 30, 2023
2 parents 8f97dc8 + 035f237 commit 591f19c
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/push_nuget.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Push NuGet

on:
release:
types: [ published ]

jobs:
release_nuget:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0.x
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore -c Release
- name: Test and code coverage
shell: pwsh
run: ./Scripts/RunTests.ps1
- name: Push NuGet
shell: pwsh
run: |
foreach($file in (Get-ChildItem "./.packages" -Recurse -Include *.nupkg)) {
dotnet nuget push $file --api-key "${{ secrets.NUGET_API }}" --source https://api.nuget.org/v3/index.json --skip-duplicate
}
1 change: 1 addition & 0 deletions Todo.Analyzer.sln
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "GitHub", "GitHub", "{AB8DDBFC-002C-48E2-AB03-71507DE18681}"
ProjectSection(SolutionItems) = preProject
.github\workflows\merge_and_pull_requests.yml = .github\workflows\merge_and_pull_requests.yml
.github\workflows\push_nuget.yml = .github\workflows\push_nuget.yml
EndProjectSection
EndProject
Global
Expand Down

0 comments on commit 591f19c

Please sign in to comment.