Skip to content

Update publish.yml

Update publish.yml #61

Workflow file for this run

name: publish to nuget
on:
push:
branches:
- master # Default release branch
jobs:
publish:
name: list on nuget
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup dotnet
uses: actions/setup-dotnet@v2
with:
dotnet-version: '8.0.x'
include-prerelease: true
- name: Build the project
run: dotnet build -c Release Snowflake/Snowflake.csproj
- name: Package the project
run: dotnet pack --no-build -c Release Snowflake/Snowflake.csproj -o .
- name: Publish Snowflake.CSharp to NuGet
run: |
PACKAGE_FILE=$(ls Snowflake.CSharp.*.nupkg | head -n 1)
if [ -z "$PACKAGE_FILE" ]; then
echo "No package file found."
exit 1
fi
echo "Pushing $PACKAGE_FILE to NuGet..."
dotnet nuget push "$PACKAGE_FILE" -s https://api.nuget.org/v3/index.json -k ${{secrets.NUGET_API_KEY}} --skip-duplicate || echo "Package already exists on NuGet."
- name: Build the Redis project
run: dotnet build -c Release Snowflake.Redis/Snowflake.Redis.csproj
- name: Package the Redis project
run: dotnet pack --no-build -c Release Snowflake.Redis/Snowflake.Redis.csproj -o .
- name: Publish Snowflake.Redis.CSharp to NuGet
run: |
PACKAGE_FILE=$(ls Snowflake.Redis.CSharp.*.nupkg | head -n 1)
if [ -z "$PACKAGE_FILE" ]; then
echo "No package file found."
exit 1
fi
echo "Pushing $PACKAGE_FILE to NuGet..."
dotnet nuget push "$PACKAGE_FILE" -s https://api.nuget.org/v3/index.json -k ${{secrets.NUGET_API_KEY}} --skip-duplicate || echo "Package already exists on NuGet."