|
1 | | -name: Process-PSModule |
| 1 | +name: Process-PSModule - CI |
2 | 2 |
|
3 | 3 | on: |
4 | 4 | workflow_call: |
|
63 | 63 | required: false |
64 | 64 | default: '.' |
65 | 65 |
|
66 | | -concurrency: |
67 | | - group: ${{ github.workflow }}-${{ github.ref }} |
68 | | - cancel-in-progress: ${{ github.ref != format('refs/heads/{0}', github.event.repository.default_branch) }} |
69 | | - |
70 | 66 | permissions: |
71 | | - contents: write # to checkout the repo and create releases on the repo |
| 67 | + contents: read # to checkout the repository |
72 | 68 | pull-requests: write # to write comments to PRs |
73 | 69 | statuses: write # to update the status of the workflow from linter |
74 | | - pages: write # to deploy to Pages |
75 | | - id-token: write # to verify the deployment originates from an appropriate source |
76 | 70 |
|
77 | 71 | jobs: |
78 | 72 | Get-Settings: |
@@ -328,67 +322,3 @@ jobs: |
328 | 322 | Prerelease: ${{ inputs.Prerelease }} |
329 | 323 | Verbose: ${{ inputs.Verbose }} |
330 | 324 | Version: ${{ inputs.Version }} |
331 | | - |
332 | | - Publish-Site: |
333 | | - if: ${{ needs.Get-TestResults.result == 'success' && needs.Get-CodeCoverage.result == 'success' && needs.Build-Site.result == 'success' && !cancelled() && github.event_name == 'pull_request' && github.event.pull_request.merged == true }} |
334 | | - needs: |
335 | | - - Get-Settings |
336 | | - - Get-TestResults |
337 | | - - Get-CodeCoverage |
338 | | - - Build-Site |
339 | | - permissions: |
340 | | - pages: write # to deploy to Pages |
341 | | - id-token: write # to verify the deployment originates from an appropriate source |
342 | | - environment: |
343 | | - name: github-pages |
344 | | - url: ${{ steps.deployment.outputs.page_url }} |
345 | | - runs-on: ubuntu-latest |
346 | | - steps: |
347 | | - - uses: actions/configure-pages@v5 |
348 | | - |
349 | | - - name: Deploy to GitHub Pages |
350 | | - id: deployment |
351 | | - uses: actions/deploy-pages@v4 |
352 | | - |
353 | | - Publish-Module: |
354 | | - if: ${{ needs.Get-Settings.result == 'success' && needs.Get-TestResults.result == 'success' && needs.Get-CodeCoverage.result == 'success' && needs.Build-Site.result == 'success' && !cancelled() && github.event_name == 'pull_request' && github.event.pull_request.merged == true }} |
355 | | - needs: |
356 | | - - Get-Settings |
357 | | - - Get-TestResults |
358 | | - - Get-CodeCoverage |
359 | | - - Build-Site |
360 | | - runs-on: ubuntu-latest |
361 | | - steps: |
362 | | - - name: Checkout Code |
363 | | - uses: actions/checkout@v5 |
364 | | - |
365 | | - - name: Download module artifact |
366 | | - uses: actions/download-artifact@v5 |
367 | | - with: |
368 | | - name: module |
369 | | - path: ${{ inputs.WorkingDirectory }}/outputs/module |
370 | | - |
371 | | - - name: Update Microsoft.PowerShell.PSResourceGet |
372 | | - shell: pwsh |
373 | | - run: | |
374 | | - Install-PSResource -Name Microsoft.PowerShell.PSResourceGet -Repository PSGallery -TrustRepository |
375 | | - |
376 | | - - name: Publish module |
377 | | - uses: PSModule/Publish-PSModule@v2 |
378 | | - env: |
379 | | - GH_TOKEN: ${{ github.token }} |
380 | | - with: |
381 | | - Name: ${{ fromJson(needs.Get-Settings.outputs.Settings).Name }} |
382 | | - ModulePath: outputs/module |
383 | | - APIKey: ${{ secrets.APIKEY }} |
384 | | - WhatIf: ${{ github.repository == 'PSModule/Process-PSModule' }} |
385 | | - AutoCleanup: ${{ fromJson(needs.Get-Settings.outputs.Settings).Publish.Module.AutoCleanup }} |
386 | | - AutoPatching: ${{ fromJson(needs.Get-Settings.outputs.Settings).Publish.Module.AutoPatching }} |
387 | | - DatePrereleaseFormat: ${{ fromJson(needs.Get-Settings.outputs.Settings).Publish.Module.DatePrereleaseFormat }} |
388 | | - IgnoreLabels: ${{ fromJson(needs.Get-Settings.outputs.Settings).Publish.Module.IgnoreLabels }} |
389 | | - IncrementalPrerelease: ${{ fromJson(needs.Get-Settings.outputs.Settings).Publish.Module.IncrementalPrerelease }} |
390 | | - MajorLabels: ${{ fromJson(needs.Get-Settings.outputs.Settings).Publish.Module.MajorLabels }} |
391 | | - MinorLabels: ${{ fromJson(needs.Get-Settings.outputs.Settings).Publish.Module.MinorLabels }} |
392 | | - PatchLabels: ${{ fromJson(needs.Get-Settings.outputs.Settings).Publish.Module.PatchLabels }} |
393 | | - VersionPrefix: ${{ fromJson(needs.Get-Settings.outputs.Settings).Publish.Module.VersionPrefix }} |
394 | | - WorkingDirectory: ${{ inputs.WorkingDirectory }} |
0 commit comments