Skip to content

Commit e6e6648

Browse files
committed
Add a workflow to publish NuGet packages
1 parent f719d5b commit e6e6648

2 files changed

Lines changed: 47 additions & 7 deletions

File tree

.github/workflows/push-nuget.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Push NuGet Package
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
tags:
8+
- "v*"
9+
10+
env:
11+
DOTNET_VERSION: '10.0.x'
12+
13+
jobs:
14+
push-nuget:
15+
name: Build,Pack and Push NuGet Package
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
- name: Checkout code
20+
uses: actions/checkout@v5
21+
22+
- name: Setup .NET
23+
uses: actions/setup-dotnet@v4
24+
with:
25+
dotnet-version: ${{ env.DOTNET_VERSION }}
26+
27+
- name: Restore
28+
run: dotnet restore
29+
30+
- name: Build
31+
run: dotnet build -c Release --no-restore
32+
33+
- name: Pack
34+
run: dotnet pack -c Release --no-build -o to_push_packs
35+
36+
- name: Push to NuGet
37+
run: dotnet nuget push to_push_packs/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate

AutoLaunch.slnx

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
<Solution>
2-
<Folder Name="/files/">
3-
<File Path="README.md" />
4-
<File Path=".editorconfig" />
5-
<File Path=".gitignore" />
6-
<File Path="Directory.Build.props" />
7-
</Folder>
8-
<Project Path="src\AutoLaunch\AutoLaunch.csproj" Type="Classic C#" />
2+
<Folder Name="/files/">
3+
<File Path="README.md"/>
4+
<File Path=".editorconfig"/>
5+
<File Path=".gitignore"/>
6+
<File Path="Directory.Build.props"/>
7+
</Folder>
8+
<Folder Name="/files/github_workflows/">
9+
<File Path=".github/workflows/push-nuget.yml"/>
10+
</Folder>
11+
<Project Path="src\AutoLaunch\AutoLaunch.csproj" Type="Classic C#"/>
912
</Solution>

0 commit comments

Comments
 (0)