Skip to content
This repository has been archived by the owner on Jan 5, 2022. It is now read-only.

Latest commit

 

History

History
 
 

setup-nuget-sources

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 

setup-nuget-sources

Configure NuGet.Config file by commenting out already existing sources with the same URL before adding it again with username, password, and API-key Linux only supports clear-text passwords so make sure you use secrets to pass in the passwords. This step requires that the 'nuget' command is available from earlier steps in the GitHub workflow. This can be achieved by using one of the two following methods:

Usage

See action.yml.

Basic Usage

This example installs NuGet and updates sources to use defined credentials.

on: push
jobs:
  build:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v1

      - name: Setup NuGet
        uses: NuGet/[email protected]
        with:
          nuget-version: 'latest'

      - name: Setup NuGet Sources
        uses: extenda/actions/setup-nuget-sources@v0
        with:
          config-file: NuGet.Config
          sources: |
            [{
              "name": "nuget.org",
              "source": "https://api.nuget.org/v3/index.json"
            },
            {
              "name": "Extenda",
              "source": "https://repo.extendaretail.com/repository/nuget-group/",
              "username": "${{ secrets.NUGET_USERNAME }}",
              "password": "${{ secrets.NUGET_PASSWORD }}",
              "apikey": "${{ secrets.NUGET_API_KEY }}"
            }]

      - uses: actions/cache@v1
        with:
          path: ~/.nuget/packages
          key: nuget-cache
          restore-keys: nuget-cache

      - name: NuGet Restore
        run: nuget restore MyProject.sln