Publish — Validate — ADServices version++ #83
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 PSGallery | |
| run-name: >- | |
| Publish | |
| ${{ github.event_name == 'push' && format('— {0}', github.event.head_commit.message) | |
| || github.event_name == 'pull_request' && format('PR #{0}: {1}', github.event.pull_request.number, github.event.pull_request.title) | |
| || github.event_name == 'schedule' && 'Scheduled' | |
| || github.event_name == 'workflow_dispatch' && 'Manual Dispatch' | |
| || github.event_name == 'workflow_run' && format('— {0}', github.event.workflow_run.display_title) | |
| || format('CI Run for commit {0}', github.sha) | |
| }} | |
| on: | |
| workflow_run: | |
| workflows: ["Validate Powershell"] | |
| types: | |
| - completed | |
| # Allows you to run this workflow manually from the Actions tab | |
| workflow_dispatch: | |
| jobs: | |
| publish: | |
| if: >- | |
| ${{ | |
| github.event.workflow_run.conclusion == 'success' | |
| && github.event.workflow_run.head_branch == 'main' | |
| && github.event.workflow_run.event == 'push' | |
| }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | |
| - uses: actions/checkout@v4 | |
| # Build any dlls in the tree | |
| - name: dotnet build | |
| shell: pwsh | |
| run: | | |
| Get-ChildItem *.csproj -Recurse | | |
| Where-Object Name -notlike '*.Tests.csproj' | | |
| ForEach-Object { dotnet build $_ } | |
| - name: Publish Module to PowerShell Gallery | |
| #formerly pcgeek86/publish-powershell-module-action@v20 | |
| uses: Pxtl/publish-powershell-module-action@v0.4.1 | |
| id: publish-modules | |
| with: | |
| NuGetApiKey: ${{ secrets.PS_GALLERY_KEY }} | |
| continueIfAlreadyPublished: true |