-
Notifications
You must be signed in to change notification settings - Fork 128
37 lines (37 loc) · 1.52 KB
/
build.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
name: build
on:
push:
branches:
- "**"
pull_request:
branches:
- "master"
jobs:
build_matrix:
strategy:
matrix:
os: [windows-latest, ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
timeout-minutes: 15
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup .NET 6.0
uses: actions/setup-dotnet@v4
with:
dotnet-version: 6.0.x
- name: Restore Google.Authenticator
run: dotnet restore ./Google.Authenticator/Google.Authenticator.csproj
- name: Restore Google.Authenticator.Tests
run: dotnet restore ./Google.Authenticator.Tests/Google.Authenticator.Tests.csproj
- name: Build Package
run: dotnet build ./Google.Authenticator/Google.Authenticator.csproj --configuration Release --no-restore
- name: Build Tests
run: dotnet build ./Google.Authenticator.Tests/Google.Authenticator.Tests.csproj --configuration Release --no-restore --no-dependencies
- name: Test
run: dotnet test ./Google.Authenticator.Tests/Google.Authenticator.Tests.csproj --no-build --verbosity normal --configuration Release
- name: Pack
if: ${{ github.ref == 'refs/heads/master' && github.event_name != 'pull_request' }}
run: |
dotnet pack ./Google.Authenticator/Google.Authenticator.csproj --configuration $(buildConfiguration) --no-build
dotnet nuget push **\*.nupkg --source 'https://api.nuget.org/v3/index.json' --skip-duplicate -k ${{ secrets.NUGET_API_KEY }}