-
Notifications
You must be signed in to change notification settings - Fork 49
40 lines (36 loc) · 1.13 KB
/
dotnet.yml
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
38
39
40
name: .NET
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
release:
types: [published]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Restore dependencies
run: dotnet restore SharpCaster.sln
- name: tag
id: tag
run: |
version="$(gh release view -q .tagName --json tagName)"
echo 'VERSION='$version >> $GITHUB_ENV
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Build
run: dotnet build --no-restore --configuration Release /p:Version=${{ env.VERSION }} Sharpcaster/Sharpcaster.csproj
- name: Package
run: dotnet pack --configuration Release /p:Version=${{ env.VERSION }} /p:packageVersion=${{ env.VERSION }} Sharpcaster/Sharpcaster.csproj
- name: Push
if: github.event_name == 'release' && github.event.action == 'published'
run: dotnet nuget push "**/*.nupkg" -k $NUGET_AUTH_TOKEN -s nuget.org
env:
NUGET_AUTH_TOKEN: ${{ secrets.NUGET }}