Skip to content

A programming framework for agentic AI

update dotnet workflow (#1669)

Xiaoyun Zhangb05b148cec56
diff --git a/.github/workflows/dotnet-build.yml b/.github/workflows/dotnet-build.yml
index 249aca474..180316617 100644
--- a/.github/workflows/dotnet-build.yml
+++ b/.github/workflows/dotnet-build.yml
@@ -4,21 +4,25 @@
name: dotnet-ci
on:
+ workflow_dispatch:
pull_request:
- branches: [ "main" ]
+ branches: [ "dotnet" ]
paths:
- 'dotnet/**'
+ push:
+ branches: [ "dotnet" ]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.head_ref }}
- cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
+ cancel-in-progress: ${{ github.ref != 'refs/heads/main' || github.ref != 'refs/heads/dotnet' }}
permissions:
contents: read
+ packages: write
jobs:
build:
- name: CI
+ name: Build
runs-on: ubuntu-latest
defaults:
run:
@@ -28,10 +32,111 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
- global-json-file: global.json
+ global-json-file: dotnet/global.json
- name: Restore dependencies
- run: dotnet restore
+ run: |
+ # dotnet nuget add source --name dotnet-tool https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json --configfile NuGet.config
+ dotnet restore -bl
- name: Build
- run: dotnet build --no-restore
+ run: |
+ echo "Build AutoGen"
+ dotnet build --no-restore --configuration Release -bl /p:SignAssembly=true
- name: Unit Test
- run: dotnet test --no-build --verbosity normal
\ No newline at end of file
+ run: dotnet test --no-build -bl --configuration Release
+ openai-test:
+ name: Run openai test
+ runs-on: ubuntu-latest
+ environment: dotnet
+ defaults:
+ run:
+ working-directory: dotnet
+ if: success() && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/dotnet')
+ needs: build
+ steps:
+ - uses: actions/checkout@v3
+ - name: Setup .NET
+ uses: actions/setup-dotnet@v3
+ with:
+ global-json-file: dotnet/global.json
+ - name: Restore dependencies
+ run: |
+ dotnet restore -bl
+ - name: Build
+ run: |
+ echo "Build AutoGen"
+ dotnet build --no-restore --configuration Release -bl /p:SignAssembly=true
+ - name: OpenAI Test
+ run: dotnet test --no-build -bl --configuration Release
+ env:
+ AZURE_OPENAI_API_KEY: ${{ secrets.AZURE_OPENAI_API_KEY }}
+ AZURE_OPENAI_ENDPOINT: ${{ secrets.AZURE_OPENAI_ENDPOINT }}
+ AZURE_GPT_35_MODEL_ID: ${{ secrets.AZURE_GPT_35_MODEL_ID }}
+ OEPNAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
+ - name: Pack
+ run: |
+ echo "Create nightly build package"
+ dotnet pack --no-build --configuration Release --output './output/nightly' -p:VersionSuffix=nightly-${{github.run_id}} -bl
+
+ echo "Create release build package"
+ dotnet pack --no-build --configuration Release --output './output/release' -bl
+
+ echo "ls output directory"
+ ls -R ./output
+ - name: Upload package
+ uses: actions/upload-artifact@v2
+ with:
+ name: nightly
+ path: ./dotnet/output/nightly
+ - name: Upload package
+ uses: actions/upload-artifact@v2
+ with:
+ name: release
+ path: ./dotnet/output/release
+ publish:
+ environment: dotnet-internal-feed
+ name: Publish to nightly feeds
+ runs-on: ubuntu-latest
+ defaults:
+ run:
+ working-directory: dotnet
+ needs: openai-test
+ steps:
+ - name: Setup .NET
+ uses: actions/setup-dotnet@v3
+ with:
+ dotnet-version: '6.0.x'
+ source-url: https://devdiv.pkgs.visualstudio.com/DevDiv/_packaging/AutoGen/nuget/v3/index.json
+ env:
+ NUGET_AUTH_TOKEN: ${{ secrets.AZURE_DEVOPS_TOKEN }}
+ - uses: actions/download-artifact@v2
+ with:
+ name: nightly
+ path: ./dotnet/output/nightly
+ - uses: actions/download-artifact@v2
+ with:
+ name: release
+ path: ./dotnet/output/release
+ - name: Publish nightly package to Azure Devops
+ run: |
+ echo "Publish nightly package to Azure Devops"
+ echo "ls output directory"
+ ls -R ./output/nightly
+ dotnet nuget push --api-key AzureArtifacts ./output/nightly/*.nupkg --skip-duplicate
+ env:
+ AZURE_ARTIFACTS_FEED_URL: https://devdiv.pkgs.visualstudio.com/DevDiv/_packaging/AutoGen/nuget/v3/index.json
+ NUGET_AUTH_TOKEN: ${{ secrets.AZURE_DEVOPS_TOKEN }}
+ - name: Publish nightly package to github package
+ run: |
+ echo "Publish nightly package to github package"
+ echo "ls output directory"
+ ls -R ./output/nightly
+ dotnet nuget push --api-key ${{ secrets.GITHUB_TOKEN }} --source "https://nuget.pkg.github.com/microsoft/index.json" ./output/nightly/*.nupkg --skip-duplicate
+ - name: Publish nightly package to agentchat myget feed
+ run: |
+ echo "Publish nightly package to agentchat myget feed"
+ echo "ls output directory"
+ ls -R ./output/nightly
+ dotnet nuget push --api-key ${{ secrets.MYGET_TOKEN }} --source "https://www.myget.org/F/agentchat/api/v3/index.json" ./output/nightly/*.nupkg --skip-duplicate
+ env:
+ MYGET_TOKEN: ${{ secrets.MYGET_TOKEN }}
+
diff --git a/.github/workflows/dotnet-run-openai-test-and-notebooks.yml b/.github/workflows/dotnet-run-openai-test-and-notebooks.yml
deleted file mode 100644
index 2a2c97188..000000000
--- a/.github/workflows/dotnet-run-openai-test-and-notebooks.yml
+++ /dev/null
@@ -1,58 +0,0 @@
-name: run-openai-test-and-notebooks
-
-on:
- pull_request_target:
- branches: [ "main" ]
- paths:
- - 'dotnet/**'
-env:
- BUILD_CONFIGURATION: Release # set this to the appropriate build configuration
-permissions: {}
- # actions: read
- # checks: read
- # contents: read
- # deployments: read
-jobs:
- build:
- environment: dotnet
- name: run-openai-test-and-notebooks
- runs-on: ubuntu-latest
- defaults:
- run:
- working-directory: dotnet
- steps:
- - name: Checkout
- uses: actions/checkout@v3
- with:
- ref: ${{ github.event.pull_request.head.sha }}
- - name: Setup .NET
- uses: actions/setup-dotnet@v3
- with:
- global-json-file: dotnet/global.json
-
- - name: Restore dependencies
- run: dotnet restore
- - name: Restore tool
- run: dotnet tool restore
- - name: Build
- run: dotnet build --no-restore -p:VersionSuffix=$GITHUB_RUN_ID --configuration '${{ env.BUILD_CONFIGURATION }}'
- - name: Pack
- run: dotnet pack --no-restore -p:VersionSuffix=$GITHUB_RUN_ID --no-build --configuration '${{ env.BUILD_CONFIGURATION }}' --output ./artifacts
- - name: run all tests
- run: dotnet test --no-restore --no-build --configuration '${{ env.BUILD_CONFIGURATION }}'
- env:
- AZURE_OPENAI_API_KEY: ${{ secrets.AZURE_OPENAI_API_KEY }}
- AZURE_OPENAI_ENDPOINT: ${{ secrets.AZURE_OPENAI_ENDPOINT }}
- AZURE_GPT_35_MODEL_ID: ${{ secrets.AZURE_GPT_35_MODEL_ID }}
-
- - name: Add local feed
- run: dotnet nuget add source --name local artifacts --configfile NuGet.config
- - name: Perform a Pester test from the .tools/run_all_notebooks.ps1
- shell: pwsh
- run: |
- Invoke-Pester .tools/run_all_notebook.ps1 -Passthru
- env:
- AZURE_OPENAI_API_KEY: ${{ secrets.AZURE_OPENAI_API_KEY }}
- AZURE_OPENAI_ENDPOINT: ${{ secrets.AZURE_OPENAI_ENDPOINT }}
- AZURE_GPT_35_MODEL_ID: ${{ secrets.AZURE_GPT_35_MODEL_ID }}
-