Skip to content

Commit ca2e588

Browse files
authored
Update publish.yml
1 parent ef60411 commit ca2e588

File tree

1 file changed

+16
-10
lines changed

1 file changed

+16
-10
lines changed

.github/workflows/publish.yml

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,24 @@ jobs:
1919
- name: Package the project
2020
run: dotnet pack --no-build -c Release Snowflake/Snowflake.csproj -o .
2121
- name: Publish Snowflake.CSharp to NuGet
22-
uses: rohith/publish-nuget@v2
23-
with:
24-
PROJECT_FILE_PATH: Snowflake/Snowflake.csproj
25-
NUGET_KEY: ${{secrets.NUGET_API_KEY}}
26-
PACKAGE_NAME: Snowflake.CSharp
22+
run: |
23+
PACKAGE_FILE=$(ls Snowflake.CSharp.*.nupkg | head -n 1)
24+
if [ -z "$PACKAGE_FILE" ]; then
25+
echo "No package file found."
26+
exit 1
27+
fi
28+
echo "Pushing $PACKAGE_FILE to NuGet..."
29+
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."
2730
- name: Build the Redis project
2831
run: dotnet build -c Release Snowflake.Redis/Snowflake.Redis.csproj
2932
- name: Package the Redis project
3033
run: dotnet pack --no-build -c Release Snowflake.Redis/Snowflake.Redis.csproj -o .
3134
- name: Publish Snowflake.Redis.CSharp to NuGet
32-
uses: rohith/publish-nuget@v2
33-
with:
34-
PROJECT_FILE_PATH: Snowflake.Redis/Snowflake.Redis.csproj
35-
NUGET_KEY: ${{secrets.NUGET_API_KEY}}
36-
PACKAGE_NAME: Snowflake.Redis.CSharp
35+
run: |
36+
PACKAGE_FILE=$(ls Snowflake.Redis.CSharp.*.nupkg | head -n 1)
37+
if [ -z "$PACKAGE_FILE" ]; then
38+
echo "No package file found."
39+
exit 1
40+
fi
41+
echo "Pushing $PACKAGE_FILE to NuGet..."
42+
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."

0 commit comments

Comments
 (0)