Skip to content

NuGet Push Public Windows #76

NuGet Push Public Windows

NuGet Push Public Windows #76

name: NuGet Push Public Windows
on: [workflow_dispatch]
jobs:
build-test-prep-push:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: '6.0.x'
- name: Clone and run Authentication
run: |
git clone https://github.com/EasyMicroservices/Authentications-Microservice.git
cd Authentications-Microservice
dotnet run --project src/CSharp/EasyMicroservices.AuthenticationsMicroservice.WebApi/EasyMicroservices.AuthenticationsMicroservice.WebApi.csproj --framework net8.0 | tee output.txt &
AUTH_PID=$!
echo "Started Authentication Service with PID $AUTH_PID"
cd ..
while true; do
grep -q 'Now listening on' output.txt && break
sleep 10
done
echo "Authentication Service started successfully"
shell: bash
- name: Clone and run WhiteLabel
run: |
git clone https://github.com/EasyMicroservices/WhiteLabels-Microservice.git
cd WhiteLabels-Microservice
dotnet run --project src/CSharp/EasyMicroservices.WhiteLabelsMicroservice.WebApi/EasyMicroservices.WhiteLabelsMicroservice.WebApi.csproj --framework net8.0 | tee output.txt &
WHITELABEL_PID=$!
echo "Started WhiteLabel Service with PID $WHITELABEL_PID"
cd ..
while true; do
grep -q 'Now listening on' output.txt && break
sleep 10
done
echo "WhiteLabels Service started successfully"
shell: bash
- name: Restore dependencies
run: dotnet restore ./src/CSharp/EasyMicroservices.Cores.sln
- name: Build
run: dotnet build ./src/CSharp/EasyMicroservices.Cores.sln --no-restore
- name: Test
run: dotnet test ./src/CSharp/EasyMicroservices.Cores.sln --no-build --verbosity normal
- name: Create the package
run: dotnet pack ./src/CSharp/EasyMicroservices.Cores.sln --output nupkgs
- name: Publish the package to NuGet.org
run: dotnet nuget push nupkgs\*.nupkg -k ${{secrets.NUGET_KEY}} -s https://api.nuget.org/v3/index.json --skip-duplicate
- name: Cleanup
if: always()
run: echo "Shutting down Authentication Service with PID $AUTH_PID"
kill $AUTH_PID echo "Authentication Service shutdown failed"
echo "Shutting down WhiteLabel Service with PID $WHITELABEL_PID"
kill $WHITELABEL_PID echo "WhiteLabel Service shutdown failed"