Merge pull request #1211 from maester365/fb-AddLongRunningVerboseOutput #333
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-module-preview | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - "powershell/**" | |
| - "!powershell/Maester.psd1" | |
| - "report/**" | |
| workflow_dispatch: | |
| permissions: | |
| id-token: write | |
| contents: write | |
| checks: write | |
| actions: read | |
| pull-requests: write | |
| statuses: write | |
| jobs: | |
| build-report: | |
| uses: ./.github/workflows/build-report.yaml | |
| create-preview-release: | |
| needs: build-report | |
| runs-on: windows-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Download updated report template | |
| if: needs.build-report.outputs.report-updated == 'true' | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: updated-report-template | |
| path: powershell/assets/ | |
| - name: Package ./tests to PowerShell module | |
| id: package-tests | |
| shell: pwsh | |
| run: ./build/Copy-MaesterTestsToPSModule.ps1 -Force | |
| - name: Set module version | |
| id: moduleversion | |
| shell: pwsh | |
| run: ./.github/workflows/minor-version-update.ps1 -preview | |
| - name: Azure CLI login | |
| uses: azure/login@v1 | |
| with: | |
| tenant-id: ${{ vars.TENTANT_ID }} | |
| client-id: ${{ vars.CLIENT_ID }} | |
| allow-no-subscriptions: true | |
| - name: Azure CLI get token | |
| run: | | |
| $kv_token=$(az account get-access-token --scope https://vault.azure.net/.default --query accessToken --output tsv) | |
| echo "::add-mask::$kv_token" | |
| echo "CODE_SIGN_AKV_ACCESS_TOKEN=$kv_token" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append | |
| - name: Install AzureSignTool | |
| run: dotnet tool install --no-cache --global AzureSignTool | |
| - name: Sign PowerShell module | |
| id: module-signing | |
| shell: pwsh | |
| run: | | |
| Copy-Item ${{ github.workspace }}/powershell -Recurse -Destination ${{ github.workspace }}/build/maester -Force | |
| Get-ChildItem ${{ github.workspace }}/build/maester -Recurse -Force -Filter *.ps* | Select-Object -ExpandProperty FullName | Out-File -FilePath ./signfiles.txt | |
| azuresigntool.exe sign --verbose ` | |
| --azure-key-vault-url "${{ secrets.CODE_SIGN_KEYVAULT }}" ` | |
| --azure-key-vault-accesstoken ${{ env.CODE_SIGN_AKV_ACCESS_TOKEN }} ` | |
| --azure-key-vault-certificate "${{ vars.CODE_SIGN_CERTIFICATENAME }}" ` | |
| --timestamp-rfc3161 "http://timestamp.digicert.com" ` | |
| --input-file-list ./signfiles.txt | |
| - name: Archive PowerShell build | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: maester-module | |
| path: | | |
| ${{ github.workspace }}/build/maester | |
| - name: Update PowerShell Module to PowerShell Gallery | |
| id: publish-to-gallery | |
| shell: pwsh | |
| run: | | |
| dir ${{ github.workspace }}/build/maester | |
| Publish-Module -Path ${{ github.workspace }}/build/maester -NuGetApiKey ${{ secrets.PS_GALLERY_KEY }} | |
| - name: Build PowerShell module for GitHub | |
| id: module-creation | |
| shell: pwsh | |
| run: | | |
| Compress-Archive -Path ${{ github.workspace }}/build/maester/* -DestinationPath ${{ github.workspace }}/maester.zip | |
| - name: Create release | |
| uses: ncipollo/release-action@v1 | |
| with: | |
| artifacts: "maester.zip" | |
| replacesArtifacts: true | |
| allowUpdates: true | |
| generateReleaseNotes: true | |
| makeLatest: false | |
| prerelease: true | |
| tag: ${{ steps.moduleversion.outputs.tag }} | |
| commit: ${{ github.sha }} |