Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@TravisEz13
Copy link
Member

Backport of #26225 to release/v7.5

Triggered by @TravisEz13 on behalf of @copilot-swe-agent

Original CL Label: CL-BuildPackaging

/cc @PowerShell/powershell-maintainers

Impact

Tooling Impact

  • Required tooling change

This PR converts the Azure DevOps Linux Packaging pipeline to GitHub Actions workflow, enabling Linux packaging in the CI pipeline. The change:

  • Updates the linux-packaging composite action to use GitHub Actions equivalents for all Azure DevOps-specific tasks
  • Enables the linux_packaging job in the Linux CI workflow
  • Fixes gem permission errors by updating Install-GlobalGem to detect GitHub Actions environment
  • Fixes git describe errors by using deep checkout (fetch-depth: 0) and calling Sync-PSTags

Regression

  • Yes
  • No

This is not a regression fix, but rather an enhancement to enable Linux packaging in GitHub Actions.

Testing

The original PR was tested through the GitHub Actions CI pipeline. The backport maintains the same functionality and testing approach:

  • Linux packaging job runs as part of the CI workflow
  • All packaging requirements are validated through the CI checks
  • The changes were successfully applied to the 7.5 release branch with one minor conflict in .github/workflows/linux-ci.yml (the job was commented out in 7.5 but is enabled by this PR)

Risk

  • High
  • Medium
  • Low

High Risk - This change affects the build and packaging infrastructure:

  • Modifies core packaging workflows and composite actions
  • Changes how Linux packages (deb, rpm, tar.gz) are built and uploaded
  • Updates the CI pipeline structure and dependencies
  • Requires proper testing to ensure packages are correctly generated for the release branch

The risk is mitigated by:

  • The changes mirror a working implementation already tested on the main branch
  • Only affects the CI/CD pipeline, not the PowerShell runtime code
  • Can be validated through CI checks before merge

Merge Conflicts

One merge conflict occurred in .github/workflows/linux-ci.yml:

  • Conflict: The release/v7.5 branch had the linux_packaging job commented out due to previous gem permission errors
  • Resolution: Accepted the incoming changes that enable and update the job with fixes applied
  • Changes: Added linux_packaging to ready_to_merge dependencies, uncommented the job, updated to use ubuntu-latest and actions/checkout@v5 with fetch-depth: 0

Copilot AI review requested due to automatic review settings November 5, 2025 19:09
@TravisEz13 TravisEz13 requested a review from a team as a code owner November 5, 2025 19:09
@TravisEz13 TravisEz13 added the CL-BuildPackaging Indicates that a PR should be marked as a build or packaging change in the Change Log label Nov 5, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR enables Linux packaging in the GitHub Actions CI workflow by fixing permission issues and implementing proper artifact handling. The packaging job was previously commented out due to gem installation permission errors.

Key Changes:

  • Fixed gem installation permission issues by detecting GitHub Actions environment and using sudo
  • Enabled and configured the linux_packaging job in the Linux CI workflow
  • Modernized the linux-packaging action with proper artifact handling and simplified extraction logic

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
build.psm1 Added $env:GITHUB_ACTIONS check to use sudo for gem installation in GitHub Actions, fixing permission errors
.github/workflows/linux-ci.yml Uncommented and enabled the linux_packaging job with proper dependencies and configuration
.github/actions/test/linux-packaging/action.yml Complete rewrite to use PowerShell for artifact extraction, add .NET setup, sync tags, and use GitHub Actions artifact upload
Comments suppressed due to low confidence (1)

.github/actions/test/linux-packaging/action.yml:1

  • This packaging step violates the 'Build and Packaging Steps Pattern' guideline. The Invoke-CIFinish function on Linux/macOS calls New-LinuxPackage which internally runs Start-PSBuild (line 884 in tools/ci.psm1), but PSOptions are being restored from a separate build step without the build artifacts. According to guideline 1000002, you must either: (1) Run build and packaging in the same step, OR (2) Properly save and restore PSOptions AND ensure build artifacts are available. Currently, you're restoring PSOptions but the build may not have the correct binaries for packaging. Consider calling Start-PSBuild before packaging or ensuring the extracted binaries match what PSOptions expects.
name: linux_packaging

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@TravisEz13 TravisEz13 enabled auto-merge (squash) November 5, 2025 19:36
@TravisEz13 TravisEz13 merged commit dcf85e0 into PowerShell:release/v7.5 Nov 5, 2025
38 of 39 checks passed
@TravisEz13 TravisEz13 deleted the backport-26225-release-7.5 branch November 5, 2025 19:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CL-BuildPackaging Indicates that a PR should be marked as a build or packaging change in the Change Log

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants