Skip to content

Commit

Permalink
Merge pull request #9 from pieces-app/feat/ai-extensions-support
Browse files Browse the repository at this point in the history
Add support for Microsoft.Extensions.AI
  • Loading branch information
jimbobbennett authored Oct 18, 2024
2 parents de8983e + 5ebb687 commit a2be8e2
Show file tree
Hide file tree
Showing 24 changed files with 1,733 additions and 228 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,31 +3,39 @@ name: Release
on:
push:
tags:
- '*'
- 'client-*'

jobs:
publish-to-nuget:
publish-client-to-nuget:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

# Set up .NET 8
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.*
- name: Build

# Build the main client nuget package
- name: Build Client
working-directory: ./src/Client
run: dotnet build -c Release -p:Version=${GITHUB_REF#refs/tags/v}
run: dotnet build -c Release -p:Version=${GITHUB_REF#refs/tags/client-v}

# Download the nuget signing certificate to a local file from the Actions secret
- name: Get the nuget signing certificate
id: cert_file
uses: timheuer/[email protected]
with:
fileName: 'certfile.pfx'
encodedString: ${{ secrets.NUGET_CERTIFICATE }}
- name: Sign the nuget package

# Sign the Client nuget package with the certificate from the Actions secret
- name: Sign the Client nuget package
working-directory: ./src/Client
run: dotnet nuget sign ./bin/Release/Pieces.OS.Client.${GITHUB_REF#refs/tags/v}.nupkg --certificate-path ${{ steps.cert_file.outputs.filePath }} --certificate-password ${{ secrets.NUGET_CERTIFICATE_PASSWORD }} --timestamper http://timestamp.digicert.com
- name: Push to NuGet
run: dotnet nuget sign ./bin/Release/Pieces.OS.Client.${GITHUB_REF#refs/tags/client-v}.nupkg --certificate-path ${{ steps.cert_file.outputs.filePath }} --certificate-password ${{ secrets.NUGET_CERTIFICATE_PASSWORD }} --timestamper http://timestamp.digicert.com

# Push the client nuget package to nuget
- name: Push the Client package to NuGet
working-directory: ./src/Client
run: dotnet nuget push ./bin/Release/*.nupkg -k ${{ secrets.NUGET_API_KEY }} -s https://nuget.org


51 changes: 51 additions & 0 deletions .github/workflows/publish-extensions-nuget.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Release

on:
push:
tags:
- 'extensions-*'

jobs:
publish-extensions-to-nuget:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

# Set up .NET 8
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.*

# Update the Pieces.OS.Client to use the latest nuget package, not the local packages
- name: Update the Pieces.OS.Client nuget package
working-directory: ./src/Extensions
run: |
dotnet remove reference ../Core/src/Pieces.Os.Core/Pieces.Os.Core.csproj
dotnet remove reference ../Client/Pieces.OS.Client.csproj
dotnet add package Pieces.OS.Client --prerelease
# Build the Microsoft.Extensions.AI implementation package
- name: Build AI Extension
working-directory: ./src/Extensions
run: dotnet build -c Release -p:Version=${GITHUB_REF#refs/tags/extensions-v}

# Download the nuget signing certificate to a local file from the Actions secret
- name: Get the nuget signing certificate
id: cert_file
uses: timheuer/[email protected]
with:
fileName: 'certfile.pfx'
encodedString: ${{ secrets.NUGET_CERTIFICATE }}

# Sign the Microsoft.Extensions.AI implementation nuget package with the certificate from the Actions secret
- name: Sign the Extensions nuget package
working-directory: ./src/Extensions
run: dotnet nuget sign ./bin/Release/Pieces.Extensions.AI.${GITHUB_REF#refs/tags/extensions-v}.nupkg --certificate-path ${{ steps.cert_file.outputs.filePath }} --certificate-password ${{ secrets.NUGET_CERTIFICATE_PASSWORD }} --timestamper http://timestamp.digicert.com

# Push the Microsoft.Extensions.AI implementation nuget package to nuget
- name: Push the Extensions package to NuGet
working-directory: ./src/Extensions
run: dotnet nuget push ./bin/Release/*.nupkg -k ${{ secrets.NUGET_API_KEY }} -s https://nuget.org


17 changes: 14 additions & 3 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,22 @@
"version": "0.2.0",
"configurations": [
{
"name": "C#: Example Debug",
"name": "Client Example Debug",
"type": "dotnet",
"request": "launch",
"projectPath": "${workspaceFolder}/src/Example/Pieces.OS.Example.csproj"
"projectPath": "${workspaceFolder}/src/Client.Example/Pieces.OS.Client.Example.csproj"
},
{
"name": "Extensions Example Debug",
"type": "dotnet",
"request": "launch",
"projectPath": "${workspaceFolder}/src/Extensions.Example/Pieces.Extensions.AI.Example.csproj"
},
{
"name": "Remind Me Sample Debug",
"type": "dotnet",
"request": "launch",
"projectPath": "${workspaceFolder}/src/SampleApps/RemindMe/Pieces.SampleApps.RemindMe.csproj"
}

]
}
26 changes: 25 additions & 1 deletion Pieces.OS.Client.sln
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,15 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Pieces.Os.Core.Test", "src\
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Pieces.OS.Client", "src\Client\Pieces.OS.Client.csproj", "{7B7F08A9-0F79-4902-8461-7EC8CC0637ED}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Pieces.OS.Example", "src\Example\Pieces.OS.Example.csproj", "{9B392DE8-CC81-4B68-AF1F-64909DA5B9CF}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Pieces.OS.Client.Example", "src\Client.Example\Pieces.OS.Client.Example.csproj", "{9B392DE8-CC81-4B68-AF1F-64909DA5B9CF}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Pieces.Extensions.AI", "src\Extensions\Pieces.Extensions.AI.csproj", "{14EEEFCD-42A3-4C85-AED5-9C00F0D53811}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Pieces.Extensions.AI.Example", "src\Extensions.Example\Pieces.Extensions.AI.Example.csproj", "{444BCCA9-ACBE-47EB-88A8-B3CF48113FA3}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SampleApps", "SampleApps", "{CC196DE0-D1B4-4AE4-9E00-51E4BE1912BC}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Pieces.SampleApps.RemindMe", "src\SampleApps\RemindMe\Pieces.SampleApps.RemindMe.csproj", "{92F96E38-8661-4AD9-AB95-C59C5E082B62}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand All @@ -46,6 +54,18 @@ Global
{9B392DE8-CC81-4B68-AF1F-64909DA5B9CF}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9B392DE8-CC81-4B68-AF1F-64909DA5B9CF}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9B392DE8-CC81-4B68-AF1F-64909DA5B9CF}.Release|Any CPU.Build.0 = Release|Any CPU
{14EEEFCD-42A3-4C85-AED5-9C00F0D53811}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{14EEEFCD-42A3-4C85-AED5-9C00F0D53811}.Debug|Any CPU.Build.0 = Debug|Any CPU
{14EEEFCD-42A3-4C85-AED5-9C00F0D53811}.Release|Any CPU.ActiveCfg = Release|Any CPU
{14EEEFCD-42A3-4C85-AED5-9C00F0D53811}.Release|Any CPU.Build.0 = Release|Any CPU
{444BCCA9-ACBE-47EB-88A8-B3CF48113FA3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{444BCCA9-ACBE-47EB-88A8-B3CF48113FA3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{444BCCA9-ACBE-47EB-88A8-B3CF48113FA3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{444BCCA9-ACBE-47EB-88A8-B3CF48113FA3}.Release|Any CPU.Build.0 = Release|Any CPU
{92F96E38-8661-4AD9-AB95-C59C5E082B62}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{92F96E38-8661-4AD9-AB95-C59C5E082B62}.Debug|Any CPU.Build.0 = Debug|Any CPU
{92F96E38-8661-4AD9-AB95-C59C5E082B62}.Release|Any CPU.ActiveCfg = Release|Any CPU
{92F96E38-8661-4AD9-AB95-C59C5E082B62}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{63B9A93A-AD4D-42C6-9A80-68853FAC4913} = {0F400239-4FC7-4A56-A1BE-553ECB4EA55E}
Expand All @@ -56,5 +76,9 @@ Global
{15767DC5-A2E1-45FB-A7A8-914E7C9A5C9E} = {FE52B15F-09C2-4D8A-952A-3ACB8C449EAA}
{7B7F08A9-0F79-4902-8461-7EC8CC0637ED} = {0F400239-4FC7-4A56-A1BE-553ECB4EA55E}
{9B392DE8-CC81-4B68-AF1F-64909DA5B9CF} = {0F400239-4FC7-4A56-A1BE-553ECB4EA55E}
{14EEEFCD-42A3-4C85-AED5-9C00F0D53811} = {0F400239-4FC7-4A56-A1BE-553ECB4EA55E}
{444BCCA9-ACBE-47EB-88A8-B3CF48113FA3} = {0F400239-4FC7-4A56-A1BE-553ECB4EA55E}
{CC196DE0-D1B4-4AE4-9E00-51E4BE1912BC} = {0F400239-4FC7-4A56-A1BE-553ECB4EA55E}
{92F96E38-8661-4AD9-AB95-C59C5E082B62} = {CC196DE0-D1B4-4AE4-9E00-51E4BE1912BC}
EndGlobalSection
EndGlobal
Loading

0 comments on commit a2be8e2

Please sign in to comment.