Skip to content

Commit

Permalink
Publish Nuget to ADO artifacts (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
TaoChenOSU authored Aug 8, 2023
1 parent cbf569e commit c78ffd6
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 0 deletions.
62 changes: 62 additions & 0 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# Publish CoreLib and Client Lib to ADO feed
name: Publish CoreLib and Client Lib to ADO feed

on:
push:
branches: ["main"]

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
dotnet-version: ['7.0.x']

environment: publish-sm-preview-packages-to-ado

permissions:
id-token: write

steps:
- uses: actions/checkout@v2
with:
clean: true

- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: ${{ matrix.dotnet-version }}
source-url: ${{ secrets.AZURE_ARTIFACTS_FEED_URL }}
env:
NUGET_AUTH_TOKEN: ${{ secrets.AZURE_DEVOPS_PAT }}

- name: Show Run and Attempt IDs
run: |
echo "Run ID: ${{ github.run_number }}"
echo "Attempt ID: ${{ github.run_attempt }}"
echo "Version: 0.0.${{ github.run_number }}.${{ github.run_attempt }}"
echo "VersionPrefix=0.0.${{ github.run_number }}.${{ github.run_attempt }}" >> $GITHUB_ENV
- name: Build and pack Client NuGet package
run: |
dotnet pack dotnet/ClientLib/ClientLib.csproj \
-c Release \
-v normal \
--version-suffix preview \
-p:VersionPrefix=${{ env.VersionPrefix }} \
--output dotnet/ClientLib/bin/Release
- name: Build and pack Core NuGet package
run: |
dotnet pack dotnet/CoreLib/CoreLib.csproj \
-c Release \
-v normal \
--version-suffix preview \
-p:VersionPrefix=${{ env.VersionPrefix }} \
--output dotnet/CoreLib/bin/Release
- name: Push Client NuGet package to ADO feed
run: dotnet nuget push dotnet/ClientLib/bin/Release/*.nupkg --api-key az

- name: Push Core NuGet package to ADO feed
run: dotnet nuget push dotnet/CoreLib/bin/Release/*.nupkg --api-key az
1 change: 1 addition & 0 deletions dotnet/ClientLib/ClientLib.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<TargetFramework>netstandard2.0</TargetFramework>
<AssemblyName>Microsoft.SemanticMemory.Client</AssemblyName>
<RootNamespace>Microsoft.SemanticMemory.Client</RootNamespace>
<IsPackable>true</IsPackable>
</PropertyGroup>

<ItemGroup>
Expand Down
1 change: 1 addition & 0 deletions dotnet/CoreLib/CoreLib.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<AssemblyName>Microsoft.SemanticMemory.Core</AssemblyName>
<RootNamespace>Microsoft.SemanticMemory.Core</RootNamespace>
<NoWarn>CA1711,CA1724,CA1308</NoWarn>
<IsPackable>true</IsPackable>
</PropertyGroup>

<ItemGroup>
Expand Down

0 comments on commit c78ffd6

Please sign in to comment.