This GitHub Action enables you to publish PowerShell module(s) to the PowerShell Gallery
- Add a GitHub Actions Workflow configuration to your GitHub project, (e.g. under
.github/workflows/main.yml) - Configure a secret on your GitHub repository, containing your PowerShell Gallery API key
- Add a step to your GitHub Actions job
For example, if you named your secret PSGALLERY_API_KEY:
- name: Publish Module(s) to PowerShell Gallery
uses: chris-peterson/publish-powershell@v1
with:
ApiKey: ${{ secrets.PSGALLERY_API_KEY }}Here's a full listing for a hypothetical project
name: CI
on:
push:
branches: [ 'main']
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Publish PowerShell Module
uses: chris-peterson/publish-powershell@v1
with:
ApiKey: ${{ secrets.PSGALLERY_API_KEY }}
environment:
name: PowerShell Gallery
url: https://www.powershellgallery.com/packages/<YOUR_PACKAGE_HERE>