Giter VIP home page Giter VIP logo

deploy-nuget's Introduction

deploy-nuget

A reusable workflow for deploying to NuGet.

Installation

  1. Add a new workflow under .github/workflows/ with the following contents.
    name: Deploy
    
    on:
      push:
        branches:
          - release/nuget
    
    jobs:
      deploy:
        uses: Arthri/deploy-nuget/.github/workflows/deploy.yml@v1
        secrets:
          NUGET-API-KEY: ${{ secrets.NUGET_API_KEY }}
  2. Create a new environment named NuGet (Stable) with a secret named NUGET-API-KEY containing the API key used to publish packages to NuGet.

Usage

  1. Create a pull request from master to release/nuget.
  2. Merge pull request.
  3. Expect workflow to build project and upload NuGet package to NuGet.

Creating the NuGet Environment

  1. Head to your repository's settings tab.
  2. Go to Code and automation > Environments.
  3. Create a new environment named NuGet (Stable).
  4. Configure environment.
  5. Add a secret named NUGET-API-KEY

Set Release Notes or Changelog

jobs:
  deploy:
    uses: Arthri/deploy-nuget/.github/workflows/deploy.yml@v1
    with:
      changelog: |
        - Added this
        - Removed that

Specify Environment Name

By default, the workflow acquires NUGET-API-KEY from an environment named NuGet (Stable). The environment name can be changed using the environment-name parameter.

jobs:
  deploy:
    uses: Arthri/deploy-nuget/.github/workflows/deploy.yml@v1
    with:
      environment-name: Custom Environment Name

Specify Project

By default, the workflow builds the singular solution or csproj in the repository's root. If there is more than one solution or project in the root, a project must be specified manually using the project-path parameter.

jobs:
  deploy:
    uses: Arthri/deploy-nuget/.github/workflows/deploy.yml@v1
    with:
      project-path: ./src/Test.App/Test.App.csproj

Disable Version Sanitization

By default, the inputted version will be sanitized to remove the v prefix and any directories. For example, a/b/c/v1.0.0 will turn into 1.0.0, and v1.2.3 will turn into 1.2.3. Sanitization is configurable. The following example demonstrates disabling version sanitization.

jobs:
  deploy:
    uses: Arthri/deploy-nuget/.github/workflows/deploy.yml@v1
    with:
      sanitize-version: false

Set Version

By default, the package's version will be set to the $(Version) property of a project. It can be overridden using configuration options.

jobs:
  deploy:
    uses: Arthri/deploy-nuget/.github/workflows/deploy.yml@v1
    with:
      version: v1.0.0

deploy-nuget's People

Contributors

arthri avatar

Stargazers

 avatar

Watchers

 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.