Skip to content

Commit 7bd5288

Browse files
authored
Create release.yml
1 parent 22d4b1c commit 7bd5288

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

.github/workflows/release.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# This workflow will build a .NET project
2+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net
3+
4+
name: Release
5+
6+
on:
7+
release:
8+
types: [published]
9+
10+
env:
11+
NET_VERSION: 8.0.100
12+
NUGET_PATH: './**/IeuanWalker.Hangfire.RecurringJob.${{ github.event.release.tag_name }}.nupkg'
13+
PROJECT_PATH: 'Scr/IeuanWalker.Hangfire.RecurringJob.Generator/IeuanWalker.Hangfire.RecurringJob.Generator.csproj'
14+
15+
jobs:
16+
build:
17+
runs-on: windows-latest
18+
steps:
19+
- uses: actions/checkout@v3
20+
- name: Setup .NET ${{ env.NET_VERSION }}
21+
uses: actions/setup-dotnet@v2
22+
with:
23+
dotnet-version: ${{ env.NET_VERSION }}
24+
- name: Restore dependencies
25+
run: dotnet restore
26+
- name: Build
27+
run: dotnet build ${{ env.PROJECT_PATH }} -c Release /p:Version=${{ github.event.release.tag_name }} --no-restore
28+
- uses: actions/upload-artifact@v3
29+
with:
30+
name: NuGet
31+
path: ${{ env.NUGET_PATH }}
32+
- name: Setup NuGet
33+
uses: NuGet/setup-nuget@v1.1.1
34+
- name: Publish
35+
run: nuget push **\*.nupkg -Source 'https://api.nuget.org/v3/index.json' -ApiKey ${{secrets.NUGET_API_KEY}}

0 commit comments

Comments
 (0)