-
Notifications
You must be signed in to change notification settings - Fork 1
38 lines (29 loc) · 1.26 KB
/
main.yml
File metadata and controls
38 lines (29 loc) · 1.26 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
38
name: Main branch and package publish
on:
push:
branches: [ main ]
jobs:
build:
name: Build and test
runs-on: ubuntu-latest
env:
NUGET_KEY: ${{ secrets.NUGET_KEY }}
CONFIGURATION: Release
PACKAGES_DIRECTORY: ./packages
NUGET_SOURCE: https://api.nuget.org/v3/index.json
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 9.x
- name: Restore dependencies
run: dotnet restore ./src/OneBitSoftware.Utilities.OperationResult.sln
- name: Build
run: dotnet build ./src/OneBitSoftware.Utilities.OperationResult.sln --no-restore --configuration "${{ env.CONFIGURATION }}"
- name: Test
run: dotnet test ./src/OneBitSoftware.Utilities.OperationResult.sln --no-build --verbosity normal
- name: Pack OneBitSoftware.Utilities.OperationResult
run: dotnet pack --no-build --configuration "${{ env.CONFIGURATION }}" ./src/OneBitSoftware.Utilities.OperationResult/OneBitSoftware.Utilities.OperationResult.csproj -o "${{ env.PACKAGES_DIRECTORY }}"
- name: Publish all packages
run: dotnet nuget push "${{ env.PACKAGES_DIRECTORY }}/*.nupkg" --source "${{ env.NUGET_SOURCE }}" --api-key "${{ env.NUGET_KEY }}" --skip-duplicate