-
Notifications
You must be signed in to change notification settings - Fork 3
44 lines (31 loc) · 1.22 KB
/
release-package.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
41
42
43
44
name: .NET Core CI
on:
push:
branches: [ main ]
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
- name: Build
run: dotnet build --no-restore --configuration Release
- name: Test
run: dotnet test --no-build --verbosity normal
- name: Publish
run: dotnet publish --no-build -c Release -o ./publish
- name: Pack
run: dotnet pack --no-build -c Release -o ./nupkg
- name: Get package version
id: package_version
run: echo "PACKAGE_VERSION=$(dotnet msbuild -property:Configuration=Release -target:PrintPackageVersion -nologo -verbosity:quiet)" >> $GITHUB_ENV
shell: bash
- name: Push
run: dotnet nuget push "./nupkg/*.nupkg" --api-key ${{ secrets.PUBLISH_TO_GITHUB }} --source https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json --skip-duplicate
- name: PushToNuget
run: dotnet nuget push "./nupkg/*.nupkg" -k ${{ secrets.PUBLISH_TO_NUGET }} -s https://api.nuget.org/v3/index.json --skip-duplicate