Skip to content

Publish to PowerShell Gallery #23

Publish to PowerShell Gallery

Publish to PowerShell Gallery #23

name: 'Publish to PowerShell Gallery'
on:
workflow_run:
workflows: ['Tag on version bump']
types:
- completed
push:
tags:
- 'v*'
workflow_dispatch:
permissions:
contents: read
jobs:
publish:
runs-on: windows-latest
if: github.event_name != 'workflow_run' || github.event.workflow_run.conclusion == 'success'
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{ github.event_name == 'workflow_run' && github.event.workflow_run.head_sha || github.ref }}
- name: Install required modules
shell: pwsh
run: |
Install-Module -Name Evergreen -Force -Scope CurrentUser
- name: Publish module to PowerShell Gallery
shell: pwsh
env:
NUGET_API_KEY: ${{ secrets.PSGALLERY_API_KEY }}
run: |
Publish-Module -Path ".\EvergreenUI" -NuGetApiKey $env:NUGET_API_KEY -Verbose