---
title: "Discussion on \"GitHub action to publish .NET packages to NuGet\" | Hashnode"
description: "Discussion on \"GitHub action to publish .NET packages to NuGet\". I have been a co-maintainer of .NET OSS library Marten and largely involved in taking care of the DevOps stuff pertaining to CI pipeline, build and docs system. In the early days, the build was driven using a RAKE build script written by Jeremy Mille..."
url: "https://hashnode.com/posts/github-action-to-publish-net-packages-to-nuget/62112e6ec6ed3906e81c2a38"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [GitHub action to publish .NET packages to NuGet](https://mysticmind.dev/github-action-to-publish-net-packages-to-nuget?utm_source=hashnode&utm_medium=feed)

I have been a co-maintainer of .NET OSS library Marten and largely involved in taking care of the DevOps stuff pertaining to CI pipeline, build and docs system. In the early days, the build was driven using a RAKE build script written by Jeremy Mille...

Feb 19, 2022 · 3 min read · mysticmind.dev  
Updated Feb 23, 2022  
Read the article

-   [#github](https://hashnode.com/tag/github)
-   [#dotnet](https://hashnode.com/tag/dotnet)

## Written by

[Babu Annamalai](https://hashnode.com/@mysticmind)

@mysticmind

  
[View profile](https://hashnode.com/@mysticmind)

Self-taught polyglot software developer. Loves web technologies and OSS. Lifetime learner in exploration mode.

Hey 👋 I am Babu Annamalai, partner and co-founder at Radarleaf Technologies. A polyglot software developer based in Bengaluru, love to work with web technologies and OSS . I am a lifetime learner in exploration mode. I spend a plenty of time working on the following OSS projects as below: Co-maintainer of Marten . I am available in the project's gitter channel to help with any queries/questions on Marten. This is the most successful and active project in terms of user base. Creator and maintainer of ReverseMarkdown.NET , MysticMind.PostgresEmbed and .NET Sort Refs I also contribute to other OSS projects as well.

## Responses 1

Markdown supported · ⌘↵ to post

[behrooz bozorgchamy](https://hashnode.com/@behroozbc)

[Feb 23, 2022](https://hashnode.com/posts/github-action-to-publish-net-packages-to-nuget/62112e6ec6ed3906e81c2a38/comment/6215e53ca03ae28fe10fc7f0)

Hi I found some issues in your sample

1.  You can replace the `configuration` flag with `env` you set like
    
    ```
    dotnet pack src/proj/proj.csproj -o ./artifacts --configuration ${{env.config}}
    ```
    
2.  You can change `env.dotnet_core_version` to **6.0.x** to download latest security updates of .NET 6
3.  I think `env.DOTNET_CLI_TELEMETRY_OPTOUT` and `env.DOTNET_SKIP_FIRST_TIME_EXPERIENCE` are not necessary and you can remove them. this is my [test](https://github.com/behroozbc/CronJobNet/actions/workflows/nuget_push.yml%20to%20check%20it)

[Babu Annamalai](https://hashnode.com/@mysticmind)

[Feb 23, 2022](https://hashnode.com/posts/github-action-to-publish-net-packages-to-nuget/62112e6ec6ed3906e81c2a38/comment/6215e53ca03ae28fe10fc7f0#reply-62165e773b11209c8fb4bd8f)

Using ${{env.config}} in `dotnet pack` - good catch, updated it.

Setting `env.dotnet_core_version` to `6.0.x` is better as you have outlined. Note that it is still an environment variable and the value can be changed as you see it fit, it is just an example.

With regards to `env.DOTNET_CLI_TELEMETRY_OPTOUT` and `env.DOTNET_SKIP_FIRST_TIME_EXPERIENCE`, GH action will run fine but the first run of any `dotnet` command will eat up some time sending telemetry data to Microsoft so it is always better to set these flags to disable it.
