Skip to content

Merge pull request #7 from asynkron/copilot/fix-60d199c5-ed32-41a9-8b… #20

Merge pull request #7 from asynkron/copilot/fix-60d199c5-ed32-41a9-8b…

Merge pull request #7 from asynkron/copilot/fix-60d199c5-ed32-41a9-8b… #20

Workflow file for this run

name: Build and Publish
on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main, develop ]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'
- name: Restore dependencies
run: dotnet restore
- name: Build solution
run: dotnet build --configuration Release --no-restore
- name: Run tests
run: dotnet test --configuration Release --no-build --verbosity normal
- name: Test Examples project can run
run: |
echo "Testing that Examples project can execute basic scenarios..."
cd Examples
timeout 30s dotnet run hello || true
echo "Examples project smoke test completed"
- name: Create NuGet packages
run: dotnet pack src/Asynkron.DurableFunctions.AzureAdapter --configuration Release --no-build --output ./packages
- name: Upload NuGet packages
uses: actions/upload-artifact@v4
with:
name: nuget-packages
path: packages/*.nupkg
retention-days: 30
- name: Publish to NuGet
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
env:
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
run: |
if [ -n "$NUGET_API_KEY" ]; then
dotnet nuget push packages/*.nupkg --api-key $NUGET_API_KEY --source https://api.nuget.org/v3/index.json --skip-duplicate
else
echo "NUGET_API_KEY not set, skipping publish"
fi