-
Notifications
You must be signed in to change notification settings - Fork 1
37 lines (29 loc) · 1.31 KB
/
dotnet.yml
File metadata and controls
37 lines (29 loc) · 1.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
name: Publish NuGet Package
on:
push:
branches:
- master
jobs:
publish:
runs-on: ubuntu-latest
steps:
# Step 1: Checkout the repository
- name: Checkout code
uses: actions/checkout@v3
# Step 2: Setup .NET environment
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: '9.0' # Adjust based on your project
# Step 3: Restore dependencies
- name: Restore dependencies
run: dotnet restore /home/runner/work/TaskMonitoring/TaskMonitoring/src/TaskMonitoring.Application/TaskMonitoring.Application.csproj
# Step 4: Build the project
- name: Build
run: dotnet build /home/runner/work/TaskMonitoring/TaskMonitoring/src/TaskMonitoring.Application/TaskMonitoring.Application.csproj --configuration Release --no-restore
# Step 5: Pack the project
- name: Pack
run: dotnet pack /home/runner/work/TaskMonitoring/TaskMonitoring/src/TaskMonitoring.Application/TaskMonitoring.Application.csproj --configuration Release --no-build -o ./packages
# Step 6: Publish package to GitHub Packages
- name: Publish to GitHub Packages
run: dotnet nuget push ./packages/*.nupkg --api-key ${{ secrets.FOR_NUGETPACKAGE }} --source "https://nuget.pkg.github.com/YAS-SIIN/index.json"