GithubHelp home page GithubHelp logo

lbotinelly / publish-nuget Goto Github PK

View Code? Open in Web Editor NEW

This project forked from brandedoutcast/publish-nuget

0.0 0.0 0.0 32 KB

๐Ÿ“ฆ GitHub action to automate publishing NuGet packages when project version changes

Home Page: https://github.com/marketplace/actions/publish-nuget

License: MIT License

JavaScript 100.00%

publish-nuget's Introduction

โœจ Publish NuGet

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

Usage

Create new .github/workflows/publish.yml file:

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@v2

      # Required for a specific dotnet version that doesn't come with ubuntu-latest / windows-latest
      # Visit bit.ly/2synnZl to see the list of SDKs that are pre-installed with ubuntu-latest / windows-latest
      # - name: Setup dotnet
      #   uses: actions/setup-dotnet@v1
      #   with:
      #     dotnet-version: 3.1.100
      
      # Publish
      - name: publish on version change
        uses: rohith/publish-nuget@v2
        with:
          PROJECT_FILE_PATH: Core/Core.csproj # Relative to repository root
          # VERSION_FILE_PATH: Directory.Build.props # Filepath with version info, relative to repository root. Defaults to project file
          # VERSION_REGEX: <Version>(.*)<\/Version> # Regex pattern to extract version info in a capturing group
          # VERSION_STATIC: Bypasses version resolution; useful for external providers like Nerdbank.GitVersioning
          # TAG_COMMIT: true # Flag to enable / disalge git tagging
          # TAG_FORMAT: v* # Format of the git tag, [*] gets replaced with version
          # NUGET_KEY: ${{secrets.NUGET_API_KEY}} # nuget.org API key
          # PACKAGE_NAME: NuGet package name, required when it's different from project name. Defaults to project name
  • With all settings on default, updates to project version are monitored on every push / PR merge to master & a new tag is created
  • If a NUGET_KEY is present then the project gets built, packed & published to nuget.org

Inputs

Most of the inputs are optional

Input Default Value Description
PROJECT_FILE_PATH File path of the project to be packaged, relative to repository root
VERSION_FILE_PATH [PROJECT_FILE_PATH] File path containing version info, relative to repository root
VERSION_REGEX <Version>(.*)<\/Version> Regex pattern to extract version info in a capturing group
VERSION_STATIC Bypasses version resolution; useful for external providers like Nerdbank.GitVersioning
TAG_COMMIT true Flag to enable / disable git tagging
TAG_FORMAT v* [*] is a placeholder for the actual project version
NUGET_KEY API key to authorize the package upload to nuget.org
PACKAGE_NAME Name of the NuGet package, required when it's different from project name

Note:
For multiple projects, every input except PROJECT_FILE_PATH can be given as env variable at job / workflow level

License

MIT

publish-nuget's People

Contributors

brandedoutcast avatar cuzzlor avatar deadpikle avatar luhis avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.