An open API service indexing awesome lists of open source software.

https://github.com/natescherer/publish-powershell-action

A GitHub Action to publish a PowerShell module or script to GitHub Packages, a NuGet repository, or the PowerShell Gallery.
https://github.com/natescherer/publish-powershell-action

Last synced: 4 months ago
JSON representation

A GitHub Action to publish a PowerShell module or script to GitHub Packages, a NuGet repository, or the PowerShell Gallery.

Awesome Lists containing this project

README

        

# Publish PowerShell GitHub Action

[![PowerShell on Windows](https://raw.githubusercontent.com/gist/natescherer/13d7121be73557627d3908f6e5559d9f/raw/4f7747f24063595a285dd33192fe1fd57fe60dee/publish-powershell-action_TestResults_Windows.md_badge.svg)](https://gist.github.com/natescherer/13d7121be73557627d3908f6e5559d9f) [![PowerShell on Linux](https://raw.githubusercontent.com/gist/natescherer/7006cea198e1726f203cde5604179d4b/raw/9aed4cd805da75c33a98968f9980f70fd7a6f7c9/publish-powershell-action_TestResults_Linux.md_badge.svg)](https://gist.github.com/natescherer/7006cea198e1726f203cde5604179d4b) [![PowerShell on macOS](https://raw.githubusercontent.com/gist/natescherer/cbc42445c9b9161db9d83db09927a66c/raw/4e43ee59dd608716106e1b3abbdf7b933b95980a/publish-powershell-action_TestResults_macOS.md_badge.svg)](https://gist.github.com/natescherer/cbc42445c9b9161db9d83db09927a66c)

[![All Contributors](https://img.shields.io/badge/all_contributors-2-orange.svg?style=flat-square)](#contributors-)

A GitHub Action to publish a PowerShell module or script to GitHub Packages, a NuGet repository, or the PowerShell Gallery.

It is tested and runs on `windows-latest`, `ubuntu-latest`, and `macos-latest`.

## Usage

```yaml
steps:
- name: Publish PowerShell Module
uses: natescherer/publish-powershell-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
target: packages
path: src
```

```yaml
steps:
- name: Publish PowerShell Module
uses: natescherer/publish-powershell-action@v1
with:
token: ${{ secrets.NUGET_TOKEN }}
target: nuget
path: src
```

```yaml
steps:
- name: Publish PowerShell Module
uses: natescherer/publish-powershell-action@v1
with:
token: ${{ secrets.GALLERY_API_KEY }}
target: gallery
path: src
```

### Inputs

| Name | Required | Default | Description |
| :---: | :------: | :-----: | ----------- |
| `token` | true | | Token to authenticate. |
| `target` | true | | Set to `packages` for GitHub Packages, `gallery` for the PowerShell Gallery, or `nuget` for a NuGet repository. |
| `path` | true | | Path to publish relative to the root of the project. Can either be a .psd1 file, a .ps1 file, or a directory. If a directory, the action will search for a .psd1 file in the root. If none are found, it will then
search for a .ps1 file in the root. |
| `nugetUrl` | false | | Url to use with NuGet target. Should be a NuGet v2 or v3 endpoint. |

### Outputs

| Name | Description |
| :---: | ----------- |
| |

## Contributors



Nate Scherer
Nate Scherer

💻 📖 🚇
Gal Villaret
Gal Villaret

💻

This project follows the [all-contributors](https://allcontributors.org) specification.
Contributions of any kind are welcome!

## License

This project is licensed under The MIT License - see [LICENSE](LICENSE) for details.

## Acknowledgements

[![Hosted By: Cloudsmith](https://img.shields.io/badge/OSS%20hosting%20by-cloudsmith-blue?logo=cloudsmith&style=flat-square)](https://cloudsmith.com)

Package repository hosting is graciously provided by Cloudsmith.