Publish to PowerShell Gallery #23
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |