Skip to content

Commit

Permalink
GitHub Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
ahwm authored Oct 28, 2024
1 parent a0a06da commit fa02f12
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -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 }}

0 comments on commit fa02f12

Please sign in to comment.