include public api docs in nugets (#4) #4
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "Publish Nugets" | |
on: | |
push: | |
tags: | |
- "v[0-9]+.[0-9]+.[0-9]+" | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
timeout-minutes: 15 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Verify commit exists in origin/main | |
run: git branch --remote --contains | grep origin/main | |
- name: Extract Tag Info | |
run: | | |
TAG=${GITHUB_REF/refs\/tags\/} | |
echo $TAG | |
PATTERN="^(v)([0-9]+(\.[0-9]+){2})$" | |
if [[ $TAG =~ $PATTERN ]]; then | |
echo "PREFIX=${BASH_REMATCH[1]}" >> $GITHUB_ENV | |
echo "VERSION=${BASH_REMATCH[2]}" >> $GITHUB_ENV | |
else | |
echo "Failed to extract tag info!" | |
exit 1 | |
fi | |
- name: echo tag info | |
run: | | |
echo "VERSION:$VERSION" | |
echo "PREFIX:$PREFIX" | |
- name: Build Palm SDK | |
run: dotnet build ./src/LLMSharp.Google.Palm/LLMSharp.Google.Palm.csproj --configuration Release | |
- name: Test | |
run: dotnet test ./tests/LLMSharp.Google.Palm.Tests/LLMSharp.Google.Palm.Tests.csproj --configuration Release | |
env: | |
GOOGLE_API_KEY: ${{ secrets.GOOGLE_API_KEY }} | |
- name: Pack v1Beta2 Proto package | |
run: dotnet pack ./src/Google.Ai.Generativelanguage.V1Beta2/Google.Ai.Generativelanguage.V1Beta2.csproj --configuration Release --output . -p:Version=${VERSION} | |
- name: Pack Palm SDK | |
run: dotnet pack ./src/LLMSharp.Google.Palm/LLMSharp.Google.Palm.csproj --configuration Release --output . -p:Version=${VERSION} | |
- name: Publish Nuget Package | |
run: dotnet nuget push LLMSharp.*.${VERSION}.nupkg --source 'https://api.nuget.org/v3/index.json' --api-key ${NUGET_API_KEY} | |
env: | |
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }} |