Skip to content

Commit 58cbddb

Browse files
authored
Merge pull request #242 from BrandonPotter/gh-actions
GitHub Actions
2 parents 6278833 + 5f69da0 commit 58cbddb

File tree

3 files changed

+49
-3
lines changed

3 files changed

+49
-3
lines changed

.github/dependabot.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,12 @@
66
version: 2
77
updates:
88
- package-ecosystem: "nuget"
9-
directory: "/Google.Authenticator"
10-
directory: "/Google.Authenticator.Tests"
9+
directories:
10+
- "/Google.Authenticator"
11+
- "/Google.Authenticator.Tests"
12+
schedule:
13+
interval: "weekly"
14+
- package-ecosystem: "github-actions"
15+
directory: "/"
1116
schedule:
1217
interval: "weekly"

.github/workflows/build.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: build
2+
on:
3+
push:
4+
branches:
5+
- "**"
6+
pull_request:
7+
branches:
8+
- "master"
9+
jobs:
10+
build_matrix:
11+
strategy:
12+
matrix:
13+
os: [windows-latest, ubuntu-latest, macos-latest]
14+
runs-on: ${{ matrix.os }}
15+
timeout-minutes: 15
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v5
19+
- name: Setup .NET 6.0
20+
uses: actions/setup-dotnet@v5
21+
with:
22+
dotnet-version: 6.0.x
23+
- name: Setup .NET 7.0
24+
uses: actions/setup-dotnet@v5
25+
with:
26+
dotnet-version: 7.0.x
27+
- name: Restore Google.Authenticator
28+
run: dotnet restore ./Google.Authenticator/Google.Authenticator.csproj
29+
- name: Restore Google.Authenticator.Tests
30+
run: dotnet restore ./Google.Authenticator.Tests/Google.Authenticator.Tests.csproj
31+
- name: Build Package
32+
run: dotnet build ./Google.Authenticator/Google.Authenticator.csproj --configuration Release --no-restore
33+
- name: Build Tests
34+
run: dotnet build ./Google.Authenticator.Tests/Google.Authenticator.Tests.csproj --configuration Release --no-restore --no-dependencies
35+
- name: Test
36+
run: dotnet test ./Google.Authenticator.Tests/Google.Authenticator.Tests.csproj --no-build --verbosity normal --configuration Release
37+
- name: Pack
38+
if: ${{ runner.os == 'Windows' && github.ref == 'refs/heads/master' && github.event_name != 'pull_request' }}
39+
run: |
40+
dotnet pack ./Google.Authenticator/Google.Authenticator.csproj --configuration $(buildConfiguration) --no-build
41+
dotnet nuget push **\*.nupkg --source 'https://api.nuget.org/v3/index.json' --skip-duplicate -k ${{ secrets.NUGET_KEY }}

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# GoogleAuthenticator
22
Simple, easy to use server-side two-factor authentication library for .NET that works with Google Authenticator
33

4-
[![Build Status](https://dev.azure.com/brandon-potter/GoogleAuthenticator/_apis/build/status/BrandonPotter.GoogleAuthenticator?branchName=master)](https://dev.azure.com/brandon-potter/GoogleAuthenticator/_build/latest?definitionId=1&branchName=master)
4+
[![build](https://github.com/BrandonPotter/GoogleAuthenticator/actions/workflows/build.yml/badge.svg)](https://github.com/BrandonPotter/GoogleAuthenticator/actions/workflows/build.yml)
55
[![NuGet Status](https://img.shields.io/nuget/v/GoogleAuthenticator.svg)](https://www.nuget.org/packages/GoogleAuthenticator/)
66

77
[`Install-Package GoogleAuthenticator`](https://www.nuget.org/packages/GoogleAuthenticator)

0 commit comments

Comments
 (0)