| name: linux_packaging |
| description: 'Linux packaging for PowerShell' |
|
|
| runs: |
| using: composite |
| steps: |
| - name: Capture Environment |
| if: success() || failure() |
| run: |- |
| Import-Module ./tools/ci.psm1 |
| Show-Environment |
| shell: pwsh |
|
|
| - uses: actions/setup-dotnet@c2fa09f4bde5ebb9d1777cf28262a3eb3db3ced7 |
| with: |
| global-json-file: ./global.json |
|
|
| - name: Bootstrap |
| run: |- |
| Import-Module ./build.psm1 |
| Start-PSBootstrap -Scenario Package |
| Import-Module ./tools/ci.psm1 |
| Invoke-CIInstall -SkipUser |
| shell: pwsh |
|
|
| - name: Build and Package |
| run: |- |
| Import-Module ./tools/ci.psm1 |
| $releaseTag = Get-ReleaseTag |
| Start-PSBuild -Configuration 'Release' -ReleaseTag $releaseTag |
| Invoke-CIFinish |
| shell: pwsh |
|
|
| - name: Install Pester |
| run: |- |
| Import-Module ./tools/ci.psm1 |
| Install-CIPester |
| shell: pwsh |
|
|
| - name: Validate Package Names |
| run: |- |
| # Run Pester tests to validate package names |
| Import-Module Pester -Force |
| $testResults = Invoke-Pester -Path ./test/packaging/linux/package-validation.tests.ps1 -PassThru |
| if ($testResults.FailedCount -gt 0) { |
| throw "Package validation tests failed" |
| } |
| shell: pwsh |
|
|
| - name: Upload deb packages |
| uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 |
| with: |
| name: packages-deb |
| path: ${{ runner.workspace }}/packages/*.deb |
| if-no-files-found: ignore |
|
|
| - name: Upload rpm packages |
| uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 |
| with: |
| name: packages-rpm |
| path: ${{ runner.workspace }}/packages/*.rpm |
| if-no-files-found: ignore |
|
|
| - name: Upload tar.gz packages |
| uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 |
| with: |
| name: packages-tar |
| path: ${{ runner.workspace }}/packages/*.tar.gz |
| if-no-files-found: ignore |
|
|