From fa02f1216e9d40102fc097d4cef7425630a4e748 Mon Sep 17 00:00:00 2001 From: Adam Date: Mon, 28 Oct 2024 15:49:25 -0600 Subject: [PATCH 1/7] GitHub Actions --- .github/workflows/build.yml | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..6e40787 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,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 $(buildConfiguration) --no-restore + - name: Build Tests + run: dotnet build ./Google.Authenticator.Tests/Google.Authenticator.Tests.csproj --configuration $(buildConfiguration) --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 }} From c2d351b11e218cea2139c3d8465eb792bdcd3aa0 Mon Sep 17 00:00:00 2001 From: Adam Date: Mon, 28 Oct 2024 15:51:44 -0600 Subject: [PATCH 2/7] add github actions to dependabot --- .github/dependabot.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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" From 66b0e6bf0ce9e4fa6acd6420f2cfc3a22bab229d Mon Sep 17 00:00:00 2001 From: Adam Date: Mon, 28 Oct 2024 15:53:36 -0600 Subject: [PATCH 3/7] fixed build issues --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6e40787..1e0680d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -25,9 +25,9 @@ jobs: - 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 $(buildConfiguration) --no-restore + 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 $(buildConfiguration) --no-restore --no-dependencies + 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 From 0b18549e2bb5b48da886f57a785078f837333f26 Mon Sep 17 00:00:00 2001 From: Adam Date: Mon, 28 Oct 2024 15:59:28 -0600 Subject: [PATCH 4/7] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) From 808c695a3392223069ad2da152c7773387afb7bc Mon Sep 17 00:00:00 2001 From: Adam Date: Wed, 13 Nov 2024 11:26:17 -0700 Subject: [PATCH 5/7] update nuget secret name and adding os condition to pack --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1e0680d..4b76e7f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -31,7 +31,7 @@ jobs: - 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' }} + 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_API_KEY }} + dotnet nuget push **\*.nupkg --source 'https://api.nuget.org/v3/index.json' --skip-duplicate -k ${{ secrets.NUGET_KEY }} From 47ebed909485e35a4ce7eb8ae80facea084c3e47 Mon Sep 17 00:00:00 2001 From: Adam Date: Mon, 23 Dec 2024 12:50:09 -0700 Subject: [PATCH 6/7] removing Azure pipeline --- build/azure-pipeline.yaml | 64 --------------------------------------- 1 file changed, 64 deletions(-) delete mode 100644 build/azure-pipeline.yaml diff --git a/build/azure-pipeline.yaml b/build/azure-pipeline.yaml deleted file mode 100644 index c3b75c8..0000000 --- a/build/azure-pipeline.yaml +++ /dev/null @@ -1,64 +0,0 @@ -name: BrandonPotter.GoogleAuthenticator - build and test -trigger: [ master ] -pr: [ master ] - -variables: - buildConfiguration: Release - -jobs: -- job: Test - - strategy: - matrix: - linux: - imageName: 'ubuntu-latest' - mac: - imageName: 'macOS-latest' - windows: - imageName: 'windows-latest' - - pool: - vmImage: $(imageName) - - steps: - - # There is a legacy project in the solution that dotnet won't build, so restoring and building individual projects - - script: dotnet restore ./Google.Authenticator/Google.Authenticator.csproj - displayName: dotnet restore package - - - script: dotnet restore ./Google.Authenticator.Tests/Google.Authenticator.Tests.csproj --no-dependencies - displayName: dotnet restore tests - - - script: dotnet build ./Google.Authenticator/Google.Authenticator.csproj --configuration $(buildConfiguration) --no-restore - displayName: build package - - - script: dotnet build ./Google.Authenticator.Tests/Google.Authenticator.Tests.csproj --configuration $(buildConfiguration) --no-restore --no-dependencies - displayName: build tests - - - task: DotNetCoreCLI@2 - displayName: test - inputs: - command: test - projects: './Google.Authenticator.Tests/Google.Authenticator.Tests.csproj' - arguments: '--configuration $(buildConfiguration)' - -- job: Pack - dependsOn: Test - condition: and(succeeded('Test'), or(eq(variables['Build.SourceBranchName'], 'master'),eq(variables['Build.SourceBranchName'], 'develop'))) - - pool: - vmImage: 'windows-latest' - - steps: - # This creates the Nuget package only if the change was from "master". It also supports publishing from a "develop" branch, which is not currently used in this project - - script: dotnet build ./Google.Authenticator/Google.Authenticator.csproj --configuration $(buildConfiguration) - displayName: build package - - - script: dotnet pack ./Google.Authenticator/Google.Authenticator.csproj --configuration $(buildConfiguration) --no-build --output %Build_ArtifactStagingDirectory% - displayName: pack - - - task: PublishBuildArtifacts@1 - inputs: - pathtoPublish: '$(Build.ArtifactStagingDirectory)' - artifactName: NugetPackage - From a5a9420703776538acbf788e2dcf6bca56cf870f Mon Sep 17 00:00:00 2001 From: Adam Date: Mon, 23 Dec 2024 12:51:37 -0700 Subject: [PATCH 7/7] add .NET 7 for tests --- .github/workflows/build.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4b76e7f..7368de4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -20,6 +20,10 @@ jobs: uses: actions/setup-dotnet@v4 with: dotnet-version: 6.0.x + - name: Setup .NET 7.0 + uses: actions/setup-dotnet@v4 + with: + dotnet-version: 7.0.x - name: Restore Google.Authenticator run: dotnet restore ./Google.Authenticator/Google.Authenticator.csproj - name: Restore Google.Authenticator.Tests