Skip to content

feat: support nightly release and Windows MSI installer#137

Open
roger-zhangg wants to merge 5 commits into
aws-actions:mainfrom
roger-zhangg:feat/nightly-and-windows-installer
Open

feat: support nightly release and Windows MSI installer#137
roger-zhangg wants to merge 5 commits into
aws-actions:mainfrom
roger-zhangg:feat/nightly-and-windows-installer

Conversation

@roger-zhangg
Copy link
Copy Markdown

Summary

  • Add version: nightly support to install the latest SAM CLI nightly release. Skips caching (the tag mutates daily) and aliases sam-nightlysam so existing workflow commands keep working.
  • Add Windows MSI installer support to use-installer: true. Runs AWS_SAM_CLI_64_PY3.msi silently, treats exit 3010 (reboot required) as success, and resolves the install dir under %ProgramFiles%\Amazon\AWSSAMCLI[_NIGHTLY]\bin.
  • Document in the README that SAM CLI is preinstalled on every GitHub-hosted runner image (Ubuntu / Windows / macOS), so this action is only needed when a specific version, the nightly release, or a self-hosted runner is involved.

Closes #129.

Implementation notes

  • installUsingNativeInstaller is now a thin dispatch over installLinuxNativeInstaller (existing logic, refactored out) and the new installWindowsNativeInstaller. macOS still rejects, with a clearer error message.
  • Windows MSI installs are intentionally not cached: the install scatters files across Program Files and the registry, and the existing actions/cache tar-based flow doesn't fit. This matches the behavior of aws-sam-cli's own install script.
  • For nightly on Windows, sam-nightly.{cmd,exe} is copied to sam.{cmd,exe} (rather than symlinked) since Windows symlinks need elevation. On Linux nightly we use a symlink.

Test plan

  • Unit tests: 38 jest tests pass, including 7 new tests covering Windows MSI download URL, msiexec invocation, exit code 3010, MSI failure paths, missing install dir, and invalid version. Plus a test for the macOS rejection message.
  • End-to-end on Linux (verified locally via node:24-bullseye Docker container): version: nightly downloads aws-sam-cli-linux-arm64.zip from sam-cli-nightly, extracts, symlinks sam → sam-nightly, and sam --version returns SAM CLI, version 1.159.1.dev202605080901.
  • CI: native-installer matrix already covers Ubuntu pinned/cache/latest. Added a nightly step. New native-installer-windows matrix covers windows-latest and windows-2022 with pinned/latest/nightly steps.
  • CI: Windows MSI install on real GitHub-hosted Windows runners (will be exercised by the new job once this PR runs).

🤖 Generated with Claude Code

Adds two new capabilities to the native installer path:

- "version: nightly" downloads from the sam-cli-nightly tag. The tag
  mutates daily, so caching is intentionally skipped. The Linux archive
  ships sam-nightly instead of sam, so a sam symlink is created.
- Windows runners are now supported via the official AWS_SAM_CLI_64_PY3.msi.
  Installs run msiexec silently, treat exit 3010 (reboot required) as
  success, and resolve the install dir from %ProgramFiles%. For nightly
  on Windows, sam-nightly.{cmd,exe} is copied to sam.{cmd,exe} so users
  can call sam consistently across releases.

README also documents that SAM CLI is preinstalled on every GitHub-hosted
runner image, so users only need this action when they need a specific
version, the nightly release, or a self-hosted runner.

Closes aws-actions#129

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@roger-zhangg roger-zhangg requested a review from a team as a code owner May 8, 2026 20:10
roger-zhangg and others added 2 commits May 8, 2026 13:19
tc.downloadTool writes to a UUID-named file by default, which Windows
Installer rejected with exit code 1603 because msiexec dispatches by
file extension. Pass an explicit destination ending in .msi so the
installer recognizes the file format.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The Windows MSI install was failing with exit code 1603 because the
runner image preinstalls SAM CLI 1.158.0 and Windows Installer rejects
silent downgrades. Bumping the pinned version to 1.159.1 (newer than
the preinstalled version) resolves the install conflict and uses a more
recent stable release across Linux and PyPI matrix tests too.

The PyPI matrix still pins SAM_VERSION=1.18.2 for older Python versions
(3.10, 3.11) since that combination intentionally tests legacy support.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Comment thread dist/index.js
Comment thread .github/workflows/test.yml
roger-zhangg and others added 2 commits May 11, 2026 13:13
GitHub-hosted Windows runners ship a recent SAM CLI preinstalled, and
Windows Installer rejects silent downgrades — `msiexec /i` for an older
or equal-version MSI fails with exit 1603. Bumping the test pin past the
preinstalled version (the previous workaround) only papers over the
issue: the same failure recurs every time the runner image is updated.

Add an `uninstallExistingWindowsSamCli` step that runs before every
Windows install (pinned, latest, nightly). It enumerates the Windows
uninstall registry for products whose `InstallLocation` matches the
target install root for the flavor (stable vs nightly) and runs
`msiexec /x` for each match. Best-effort: warns and continues on
failure, letting the subsequent install surface the real error.

Restore the pinned-version Windows MSI test to 1.139.0 so it actually
exercises the downgrade path against the runner's preinstalled version.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…tion

The previous uninstall-before-install step filtered registry entries by
`InstallLocation -ieq <install root>`, but the AWS SAM CLI MSI does not
populate `ARPINSTALLLOCATION`, so that field is empty in the uninstall
registry — the filter matched zero entries and the subsequent `msiexec
/i` still hit exit 1603 (downgrade rejected).

Match by `DisplayName -like 'AWS SAM Command Line Interface*'` instead,
which the install log confirms is reliably set. Stable and nightly are
distinguished by whether the DisplayName contains "Nightly" so the two
products remain isolated.

Also log a "no matching entry found" line so future failures of this
kind are easier to diagnose from the action output.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.

Feature request: Support install nightly version

2 participants