Skip to content

Conversation

@MariusStorhaug
Copy link
Member

@MariusStorhaug MariusStorhaug commented Apr 26, 2025

🩹 [Patch]: Get package from GitHub release for Linux and macOS

This release updates the PowerShell installation process to streamline installation logic for different operating systems, using the GitHub releases on the PowerShell repository as source.

Improvements to installation logic

  • Linux installation process:
    • Replaced APT-specific logic with a more generic approach to support both Debian/Ubuntu and RHEL/Fedora/CentOS distributions. Added architecture detection to determine the appropriate package format (.deb or .rpm).
    • Enhanced error handling for unsupported Linux distributions.
  • macOS installation process:
    • Simplified version resolution logic for case-insensitive matching of the "latest" keyword.
    • Improved architecture detection and package download logic for macOS.
  • Windows installation process:
    • Added better logging for detected and requested versions. Improved error handling for download failures.

Enhancements to logging

  • Added logs to display the currently installed PowerShell version or indicate if it is not installed. This applies to all platforms (Linux, macOS, and Windows).
  • Included messages for successful installations and download URLs for better traceability.

Code consistency and maintainability

  • Introduced working-directory: ${{ github.action_path }} for all steps to ensure consistent execution paths.
  • Removed redundant or outdated logic, such as Homebrew-specific handling on macOS and APT-specific handling on Linux, in favor of a unified approach.

Copilot AI review requested due to automatic review settings April 26, 2025 12:16
Copy link

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 pull request updates the package retrieval logic to support GitHub releases on both Linux and macOS. It adds a Debian/Ubuntu branch that uses dpkg for installation, introduces a case statement to handle the "latest" version input with improved error messaging, and refines the macOS pkg download process.

Comments suppressed due to low confidence (1)

action.yml:125

  • [nitpick] Consider renaming the variable in the macOS branch (e.g., to MACOS_ARCH) to avoid potential confusion with the ARCH variable set earlier for Linux.
ARCH=$(uname -m)

@MariusStorhaug MariusStorhaug self-assigned this Apr 26, 2025
@MariusStorhaug MariusStorhaug merged commit 0605bcb into main Apr 26, 2025
21 checks passed
@MariusStorhaug MariusStorhaug deleted the fixSource branch April 26, 2025 13:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants