diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 046993b..feb6984 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -6,7 +6,12 @@ version: 2 updates: - package-ecosystem: "nuget" - directory: "/Google.Authenticator" - directory: "/Google.Authenticator.Tests" + directories: + - "/Google.Authenticator" + - "/Google.Authenticator.Tests" + schedule: + interval: "weekly" + - package-ecosystem: "github-actions" + directory: "/" schedule: interval: "weekly" diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..476578d --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,41 @@ +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@v5 + - name: Setup .NET 6.0 + uses: actions/setup-dotnet@v5 + with: + dotnet-version: 6.0.x + - name: Setup .NET 7.0 + uses: actions/setup-dotnet@v5 + with: + dotnet-version: 7.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: ${{ runner.os == 'Windows' && 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_KEY }} diff --git a/README.md b/README.md index b233ed5..2fc33b0 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # GoogleAuthenticator Simple, easy to use server-side two-factor authentication library for .NET that works with Google Authenticator -[![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) +[![build](https://github.com/BrandonPotter/GoogleAuthenticator/actions/workflows/build.yml/badge.svg)](https://github.com/BrandonPotter/GoogleAuthenticator/actions/workflows/build.yml) [![NuGet Status](https://img.shields.io/nuget/v/GoogleAuthenticator.svg)](https://www.nuget.org/packages/GoogleAuthenticator/) [`Install-Package GoogleAuthenticator`](https://www.nuget.org/packages/GoogleAuthenticator)