Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 73 additions & 0 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: CI/CD Pipeline

on:
push:
branches: [ main ]
tags:
- 'v*.*.*'
pull_request:
branches: [ main ]

jobs:
test:
name: Run Integration Tests
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup .NET SDK
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
9.0.x
10.0.x

- name: Restore dependencies
run: dotnet restore src/IlyaKo.AspNet.SideAuth.slnx

- name: Build solution
run: dotnet build src/IlyaKo.AspNet.SideAuth.slnx --configuration Release --no-restore

- name: Run Integration Tests
run: |
dotnet run --project src/IlyaKo.AspNet.SideAuth.IntegrationTests/IlyaKo.AspNet.SideAuth.IntegrationTests.csproj \
--configuration Release \
--no-build

release:
name: Pack & Publish NuGet
needs: test
if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/'))
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup .NET SDK
uses: actions/setup-dotnet@v4
with:
dotnet-version: 10.0.x

- name: Pack NuGet Package
run: dotnet pack src/IlyaKo.AspNet.SideAuth/IlyaKo.AspNet.SideAuth.csproj --configuration Release --output ./output

- name: Extract Version from Tag
id: get_version
run: echo "VERSION=${GITHUB_REF_NAME#v}" >> $GITHUB_ENV

- name: Pack NuGet Package
run: |
dotnet pack src/IlyaKo.AspNet.SideAuth/IlyaKo.AspNet.SideAuth.csproj \
--configuration Release \
--output ./output \
/p:PackageVersion=${{ env.VERSION }} \
/p:Version=${{ env.VERSION }}

- name: Push to NuGet.org
run: |
dotnet nuget push ./output/*.nupkg \
--api-key ${{ secrets.NUGET_API_KEY }} \
--source https://api.nuget.org/v3/index.json \
--skip-duplicate
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<PublishAot>true</PublishAot>
<IsAotCompatible>true</IsAotCompatible>
<InterceptorsNamespaces>$(InterceptorsNamespaces);Microsoft.AspNetCore.OpenApi.Generated</InterceptorsNamespaces>
<TestingPlatformDotnetTestSupport>true</TestingPlatformDotnetTestSupport>
</PropertyGroup>

<ItemGroup>
Expand Down
Loading