这是indexloc提供的服务,不要输入任何密码
Skip to content

odannyc/publish-nuget

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

✨ Publish NuGet

GitHub action to build, pack & publish nuget pacakges automatically when a project version is updated

Usage

Create a new .github/workflows/publish-nuget.yml file:

name: publish to nuget
on:
  push:
    branches:
      - master # Your default release branch
jobs:
  publish:
    name: publish to nuget
    runs-on: ubuntu-latest
    steps:
      # Checkout
      - uses: actions/checkout@v2
        with:
          fetch-depth: 2 # This must be >= 2 to compare commits

      # Optional step, add only for a specific dotnet version that doesn't come with ubuntu-latest
      # For a list of software that comes pre-installed with ubuntu-latest visit bit.ly/2synnZl
      # - name: Setup dotnet
      #   uses: actions/setup-dotnet@v1
      #   with:
      #     dotnet-version: 3.1.100
      
      # Publish
      - name: Publish if version is updated
        uses: rohith/publish-nuget@v1
        # with: # All inputs are optional (details given below)
        #   project_dir: src # Defaults to repository root
        #   tag_format: v* # [*] gets replaced with version
        #   nuget_key: ${{secrets.NUGET_API_KEY}} # nuget.org API key

Project version updates are monitored on every push / PR merge to master & a new tag is created to denote the updated version. If a nuget_key is passed then the project gets built, packed & published to nuget.org

Inputs

All these inputs are optional

Input Description
project_dir Directory path containing the project file, defaults to repository root
tag_format Defaults to v* - [*] is a placeholder for the actual project version
nuget_key API key to authorize the package upload to nuget.org

Note:
project_dir & tag_format have default values but a package cannot be published without the nuget_key

License

MIT

About

📦 GitHub action to automate publishing NuGet packages when project version changes

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%