Skip to content

Fix #129: Add one-command cross-platform installers - #131

Merged
samdark merged 6 commits into
masterfrom
issue-129-linux-installer
Aug 4, 2026
Merged

Fix #129: Add one-command cross-platform installers#131
samdark merged 6 commits into
masterfrom
issue-129-linux-installer

Conversation

@samdark

@samdark samdark commented Aug 4, 2026

Copy link
Copy Markdown
Member

Summary

  • add a checksum-verified installer/updater for Linux x86-64 and Apple-silicon macOS
  • add a native PowerShell installer/updater for Windows x86-64 that persists its directory in the user PATH
  • atomically replace existing binaries and support install-directory and version overrides
  • put the platform commands near the beginning of the README and documentation, and update the roadmap
  • add integration coverage for Linux and simulated macOS, plus Windows installer contract coverage

Closes #129.

Verification

  • make test CLI_ARGS=tests/Unit/Packaging/InstallerTest.php — 6 tests, 91 assertions
  • make psalm
  • sh -n install.sh
  • ran the Linux installer twice against the latest published release using a temporary install directory; the installed binary ran successfully

macOS and Windows execution cannot be performed on this Linux host; their release asset selection, checksum, atomic replacement, and update contracts are covered by the installer tests.

Summary by CodeRabbit

  • New Features

    • Added one-command installers for Linux, macOS Apple silicon, and Windows.
    • Installers verify downloads, support pinned versions and custom directories, update existing installations, and add the command to PATH.
    • Added Windows PowerShell installation support.
  • Documentation

    • Updated installation and quickstart guides to use the globally installed yiipress command.
    • Added guidance for checksum verification, updates, PATH configuration, and common commands.
  • Tests

    • Added coverage for successful installations, updates, platform selection, custom paths, checksum failures, and Windows installation.

Copilot AI lite review requested due to automatic review settings August 4, 2026 12:03
@coderabbitai

coderabbitai Bot commented Aug 4, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@samdark, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 46 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 72566eed-7c04-4e4d-b017-91267edfe379

📥 Commits

Reviewing files that changed from the base of the PR and between 63c524a and c2671b2.

📒 Files selected for processing (5)
  • build/PharArchiveFilter.php
  • install.ps1
  • install.sh
  • tests/Unit/Packaging/ConfigurationPackagingTest.php
  • tests/Unit/Packaging/InstallerTest.php
📝 Walkthrough

Walkthrough

Adds POSIX and PowerShell installers for verified YiiPress binaries. Updates documentation to use the globally installed yiipress command. Adds installer integration tests and line-ending rules.

Changes

Installer distribution

Layer / File(s) Summary
POSIX installer flow
.gitattributes, install.sh
The POSIX installer detects supported platforms, downloads release archives, verifies SHA-256 checksums, validates the binary, handles permissions, and installs atomically.
Windows installer flow
install.ps1
The PowerShell installer validates Windows x64, downloads and verifies the release, installs yiipress.exe atomically, updates user PATH, and cleans temporary files.
Installer integration validation
tests/Unit/Packaging/InstallerTest.php
Tests cover installation, updates, checksum failures, platform selection, pinned releases, custom directories, sudo fallback, and Windows installer requirements.
Global command documentation
README.md, docs/README.md, docs/binaries-phar-docker.md, docs/quickstart.md, roadmap.md
Documentation describes platform installers, updates, checksum verification, PATH behavior, custom directories, and global yiipress commands.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Developer
  participant Installer
  participant ReleaseArtifacts
  participant InstallDirectory
  Developer->>Installer: Run platform installer
  Installer->>ReleaseArtifacts: Download archive and checksum manifest
  Installer->>Installer: Verify checksum and expected executable
  Installer->>InstallDirectory: Atomically replace installed binary
  Installer-->>Developer: Report installed command and PATH status
Loading

Possibly related PRs

  • yiipress/engine#34: Updates documentation for binary-first YiiPress usage.
  • yiipress/engine#36: Produces the macOS and Windows release artifacts consumed by these installers.
  • yiipress/engine#44: Provides versioned binary archives and checksums used by the installer scripts.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The changes satisfy issue #129 by adding global one-command installers for Linux, macOS, and Windows with supporting documentation and tests.
Out of Scope Changes check ✅ Passed The installer scripts, documentation, roadmap update, line-ending rules, and tests directly support the linked installer objective.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: adding one-command cross-platform installers. It directly reflects the primary objective and the substantive changes across install.sh, install.ps1, and related documentation.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch issue-129-linux-installer

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@samdark
samdark force-pushed the issue-129-linux-installer branch from 731397c to a39a811 Compare August 4, 2026 12:08

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds a checksum-verified, one-command Linux (amd64) installer (install.sh) intended to install/update yiipress globally, and updates top-level/docs guidance plus a PHPUnit test to validate the installer behavior.

Changes:

  • Introduce install.sh that downloads a release asset + SHA256SUMS, verifies the checksum, and atomically replaces an existing binary in the install dir (with sudo escalation when needed).
  • Update README and docs to surface the Linux installer command early and adjust installation guidance accordingly.
  • Add a PHPUnit installer test and mark the roadmap item as completed.

Reviewed changes

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

Show a summary per file
File Description
install.sh New Linux installer script with checksum verification and atomic install/update behavior.
tests/Unit/Packaging/InstallerTest.php New integration-style unit test exercising installer happy path + checksum failure path.
README.md Adds “Install or update on Linux” section and shifts examples toward global yiipress usage.
docs/README.md Mirrors README’s Linux installer instructions in docs landing page.
docs/binaries-phar-docker.md Documents Linux installer behavior and env-var overrides for install dir/version.
roadmap.md Checks off issue #129 as completed.
.gitattributes Enforces LF line endings for .sh files.
Suppressed comments (2)

README.md:59

  • The README now assumes the binary is always on PATH (using yiipress ...), but several docs pages still explicitly assume a project-local binary and use ./yiipress (for example docs/commands.md). Adding a short note here about using ./yiipress when the binary is in the project directory would prevent confusing, inconsistent onboarding instructions.
- For GitHub Actions: the YiiPress build action, which downloads the Linux binary automatically.
- For container workflows: Docker, using the published binary-only YiiPress image.

tests/Unit/Packaging/InstallerTest.php:140

  • The proc_open pipes are read but never closed. Closing the pipe streams before proc_close avoids leaking file descriptors and is the recommended pattern for proc_open usage.

        $archive = $this->root . '/release/' . $asset;
        $pipes = [];
        $process = proc_open(

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

Comment thread tests/Unit/Packaging/InstallerTest.php
Comment thread tests/Unit/Packaging/InstallerTest.php
@samdark samdark changed the title Fix #129: Add one-command Linux installer Fix #129: Add one-command cross-platform installers Aug 4, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@install.ps1`:
- Line 57: Update the file replacement logic around [IO.File]::Move in the
installer to support Windows PowerShell 5.1: call the two-argument File.Move
overload when $Target is absent, and call File.Replace with a null backup path
when the target already exists. Preserve the existing source and destination
variables and replacement behavior.

In `@install.sh`:
- Around line 82-100: Update the extracted binary validation after the tar
command to require that ${work_dir}/yiipress is a regular file and not a
symbolic link, using a non-following symlink check alongside the existing file
check. Keep the existing error message and exit behavior, and only allow the
subsequent elevated install commands to run after this validation succeeds.

In `@README.md`:
- Around line 25-31: Replace the mutable master installer URLs in README.md
lines 25-31, docs/README.md lines 18-24, and docs/binaries-phar-docker.md lines
8-14 with the same immutable or signed bootstrap mechanism for both Unix and
Windows instructions, preserving consistent commands across all three pages.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 891715c4-a0a8-4d89-959d-14d4ad42b4e5

📥 Commits

Reviewing files that changed from the base of the PR and between 29eb698 and 63c524a.

📒 Files selected for processing (9)
  • .gitattributes
  • README.md
  • docs/README.md
  • docs/binaries-phar-docker.md
  • docs/quickstart.md
  • install.ps1
  • install.sh
  • roadmap.md
  • tests/Unit/Packaging/InstallerTest.php

Comment thread install.ps1 Outdated
Comment thread install.sh
Comment thread README.md
@samdark
samdark merged commit 6df773f into master Aug 4, 2026
12 checks passed
@samdark
samdark deleted the issue-129-linux-installer branch August 4, 2026 13:35
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.

Add one-command installer to README

2 participants