Skip to content

zyactions/dotnet-restore

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

.NET Setup

License: MIT CI Ubuntu macOS Windows

A GitHub Action that wraps the .NET CLI dotnet restore command.

Features

  • Wraps the dotnet restore .NET CLI command
    • Provides a structured way of using this command in a workflow
  • Supports all platforms (Linux, macOS, Windows)

Note

This action provides a wrapper around the dotnet restore .NET CLI command. For further details, please check out the official documentation.

Usage

Restore Packages

steps:
  - ...
  - name: .NET Restore
    uses: zyactions/dotnet-restore@v1

The dotnet restore command automatically searches for a Visual Studio Solution file (*.sln) in the repository root.

Restore Packages for a specific Project- or Solution

steps:
  - ...
  - name: .NET Restore
    uses: zyactions/dotnet-restore@v1
    with:
      working-directory: test
      workspace: Tests.sln

Inputs

working-directory

The working-directory for the action.

Defaults to the repository root directory (github.workspace).

Note

If a specific .NET SDK version is to be used, the working directory must point to the directory that contains the global.json or a subdirectory of it.

workspace

The Visual Studio workspace (directory, project- or solution-file).

This path is relative to the working-directory unless an absolute path is used.

The dotnet restore command automatically searches for a Visual Studio Solution file (*.sln) in the specified workspace directory, if no explicit solution- or project- file is specified.

Example values:

  • path/to/workspace
  • path/to/Solution.sln
  • path/to/Project.csproj

configfile

The NuGet configuration file (nuget.config) to use. If specified, only the settings from this file will be used. If not specified, the hierarchy of configuration files from the current directory will be used. For more information, see Common NuGet Configurations.

ignore-failed-sources

Only warn about failed sources if there are packages meeting the version requirement.

force

Forces all dependencies to be resolved even if the last restore was successful. Specifying this flag is the same as deleting the project.assets.json file.

force-evaluate

Forces restore to reevaluate all dependencies even if a lock file already exists.

use-lock-file

Enables project lock file to be generated and used with restore.

lock-file-path

Output location where project lock file is written. By default, this is PROJECT_ROOT\packages.lock.json.

locked-mode

Don't allow updating project lock file. This is useful when deterministic builds are required.

Requirements

The .NET CLI needs to be installed on the runner. To be independent from the GitHub defaults, it's recommended to install a specific version of the SDK prior to calling this action.

To install the .NET SDK in your workflow, the following actions can be used:

Dependencies

This action does not use external dependencies.

Versioning

Versions follow the semantic versioning scheme.

License

.NET Restore Action is licensed under the MIT license.