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.
- Host: GitHub
- URL: https://github.com/natescherer/publish-powershell-action
- Owner: natescherer
- License: mit
- Created: 2021-04-01T16:30:18.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2024-02-18T23:53:21.000Z (about 1 year ago)
- Last Synced: 2024-05-22T22:35:03.087Z (11 months ago)
- Language: PowerShell
- Homepage:
- Size: 106 KB
- Stars: 9
- Watchers: 3
- Forks: 4
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
- jimsghstars - natescherer/publish-powershell-action - A GitHub Action to publish a PowerShell module or script to GitHub Packages, a NuGet repository, or the PowerShell Gallery. (PowerShell)
README
# Publish PowerShell GitHub Action
[](https://gist.github.com/natescherer/13d7121be73557627d3908f6e5559d9f) [](https://gist.github.com/natescherer/7006cea198e1726f203cde5604179d4b) [](https://gist.github.com/natescherer/cbc42445c9b9161db9d83db09927a66c)
[](#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
💻 📖 🚇
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
[](https://cloudsmith.com)
Package repository hosting is graciously provided by Cloudsmith.