Skip to content

Refactor installer scripts and update CI workflows#160

Merged
ss-o merged 14 commits into
mainfrom
ci/org-project-tracker-scripts
May 16, 2026
Merged

Refactor installer scripts and update CI workflows#160
ss-o merged 14 commits into
mainfrom
ci/org-project-tracker-scripts

Conversation

@ss-o
Copy link
Copy Markdown
Member

@ss-o ss-o commented May 16, 2026

This pull request makes significant updates to the project's CI/CD workflows, focusing on improving automation reliability, coverage, and maintainability. It also cleans up custom dictionary files and removes several unused or deprecated GitHub Actions workflows. The most important changes are grouped below:

CI/CD Workflow Improvements:

  • Expanded test coverage in .github/workflows/check-linux.yml, .github/workflows/check-macos.yml, and .github/workflows/win-install.yml to include lib/zsh/**, tests/**, and updated install/uninstall logic to better handle XDG-compliant paths and add new verification steps. [1] [2] [3] [4] [5]
  • Updated actions and dependencies to latest versions across workflows for improved security and compatibility (e.g., actions/checkout@v6.0.2, ludeeus/action-shellcheck@2.0.0). [1] [2] [3] [4] [5] [6] [7] [8] [9]
  • Added explicit workflow permissions and concurrency controls to all major workflows for better security and resource management. [1] [2] [3] [4] [5] [6]

Workflow Removals and Cleanups:

  • Removed obsolete workflows: rebase-action.yml, stale-action.yml, sync-labels.yml, and wrangler.yml, reducing maintenance overhead and potential for confusion. [1] [2] [3] [4]

Project Dictionary and Editor Config Updates:

  • Cleaned up and consolidated custom spelling word lists in .cspell/project-words.txt, .github/.cspell/project-words.txt, .github/.cspell/project-ignored.txt, and .github/.cspell/project-usernames.txt. [1] [2] [3] [4]
  • Removed lengthy comments and legacy configuration from .editorconfig for clarity and maintainability.

Other Notable Improvements:

  • Improved deployment and checksum workflows with better metadata handling, repository checks, and permission settings. [1] [2] [3] [4]

Overall, these changes modernize and streamline the project's automation, improve test reliability, and reduce technical debt.

ss-o and others added 14 commits May 15, 2026 23:58
Remove obsolete cspell word lists, editorconfig, vscode settings,
and retired workflows (rebase, stale, sync-labels, wrangler).
Drop legacy installer scripts i.sh and install_alpha.sh.
- Bump actions/checkout to v6.0.2 and shellcheck to 2.0.0
- Add lib/zsh/** and tests/** to push/PR path triggers
- Add permissions: contents: read and timeout-minutes: 10
- Use github.ref in concurrency group
- Replace ~/.zi hard-coded paths with XDG_DATA_HOME equivalents
- Add unit-fixture step calling tests/installers.sh
- Remove wrangler deploy job; update trunk linter config
sync-init.sh verifies (and optionally replaces) the local lib/zsh/init.zsh
against the canonical GitHub raw main copy. Supports --write, --local,
--remote, --checksum-url and --no-checksum flags.

tests/installers.sh provides a POSIX sh test suite covering:
- script syntax validation (sh -n / zsh -n)
- checksum integrity checks
- loader install with XDG path and branch-override assertions
- standalone zpmod delegation test
- sync-init fixture round-trip test
install.sh:
- Add set -eu; use WORKDIR=$(mktemp -d) with safe trap cleanup
- Replace ~/.zi with XDG_DATA_HOME-aware path
- Fix sed command for ZI[STREAM] substitution
- Correct cd fallback from return to exit 1
- Guard branch pull with BOPT; add exit 1 on failed clone
- Fix .zshrc loader snippet variable quoting

install_zpmod.sh:
- Add set -eu, file header and WORKDIR trap
- Add pure-POSIX _zi_ver_ge() replacing expr string comparison
- Honour XDG_DATA_HOME for ZI_HOME default
- Replace exit 255 with exit 1 throughout

lib/zsh/init.zsh:
- Update default branch to use ZI[STREAM] parameter
- Align loader paths with XDG layout
- Exclude AI agent instruction files from git tracking
  (AGENTS.md, CLAUDE.md, GEMINI.md, .github/copilot-instructions.md)
- Add .geminiignore
- Regenerate lib/checksum.txt to reflect updated scripts
- Document sync-init.sh usage in docs/README.md
- Remove deprecated git.io short URLs from README
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Update all internal references to reflect the repository rename:
- .trunk/trunk.yaml repo name
- workflow repository guards (checksum, rclone-action, deploy-gh-pages)
- win-install safe.directory path
- docs/README.md VSCode and jsDelivr URLs
@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented May 16, 2026

Deploying src with  Cloudflare Pages  Cloudflare Pages

Latest commit: 07e7143
Status: ✅  Deploy successful!
Preview URL: https://76cbaea8.zi-src.pages.dev
Branch Preview URL: https://ci-org-project-tracker-scrip.zi-src.pages.dev

View logs

@ss-o ss-o marked this pull request as ready for review May 16, 2026 13:45
Copilot AI review requested due to automatic review settings May 16, 2026 13:45
@ss-o ss-o merged commit e53c4fb into main May 16, 2026
7 of 9 checks passed
@ss-o ss-o deleted the ci/org-project-tracker-scripts branch May 16, 2026 13:48
github-actions Bot pushed a commit that referenced this pull request May 16, 2026
* chore: remove deprecated files and configs

Remove obsolete cspell word lists, editorconfig, vscode settings,
and retired workflows (rebase, stale, sync-labels, wrangler).
Drop legacy installer scripts i.sh and install_alpha.sh.

* ci: update workflows and trunk configuration

- Bump actions/checkout to v6.0.2 and shellcheck to 2.0.0
- Add lib/zsh/** and tests/** to push/PR path triggers
- Add permissions: contents: read and timeout-minutes: 10
- Use github.ref in concurrency group
- Replace ~/.zi hard-coded paths with XDG_DATA_HOME equivalents
- Add unit-fixture step calling tests/installers.sh
- Remove wrangler deploy job; update trunk linter config

* feat: add sync-init.sh and tests/installers.sh

sync-init.sh verifies (and optionally replaces) the local lib/zsh/init.zsh
against the canonical GitHub raw main copy. Supports --write, --local,
--remote, --checksum-url and --no-checksum flags.

tests/installers.sh provides a POSIX sh test suite covering:
- script syntax validation (sh -n / zsh -n)
- checksum integrity checks
- loader install with XDG path and branch-override assertions
- standalone zpmod delegation test
- sync-init fixture round-trip test

* refactor: migrate installer scripts to XDG paths and harden POSIX

install.sh:
- Add set -eu; use WORKDIR=$(mktemp -d) with safe trap cleanup
- Replace ~/.zi with XDG_DATA_HOME-aware path
- Fix sed command for ZI[STREAM] substitution
- Correct cd fallback from return to exit 1
- Guard branch pull with BOPT; add exit 1 on failed clone
- Fix .zshrc loader snippet variable quoting

install_zpmod.sh:
- Add set -eu, file header and WORKDIR trap
- Add pure-POSIX _zi_ver_ge() replacing expr string comparison
- Honour XDG_DATA_HOME for ZI_HOME default
- Replace exit 255 with exit 1 throughout

lib/zsh/init.zsh:
- Update default branch to use ZI[STREAM] parameter
- Align loader paths with XDG layout

* chore: update gitignore, checksums, and docs

- Exclude AI agent instruction files from git tracking
  (AGENTS.md, CLAUDE.md, GEMINI.md, .github/copilot-instructions.md)
- Add .geminiignore
- Regenerate lib/checksum.txt to reflect updated scripts
- Document sync-init.sh usage in docs/README.md
- Remove deprecated git.io short URLs from README

* ci(check-linux): add init.zsh sync-drift detection step

* fix(install.sh): verify zi.zsh exists after clone, not just directory

* ci: add concurrency to checksum.yml; add smoke-test to win-install.yml

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* chore: rename repo references from zi-src to src

Update all internal references to reflect the repository rename:
- .trunk/trunk.yaml repo name
- workflow repository guards (checksum, rclone-action, deploy-gh-pages)
- win-install safe.directory path
- docs/README.md VSCode and jsDelivr URLs

* ci: add org project tracker scripts (label sync + workflow rollout)

* fix(ci): continue label sync after repo failures

* chore: fix lint issues and syntax errors reported by trunk

---------

Co-authored-by: Salvydas Lukosius <ss-o@users.noreply.github.com> e53c4fb
Copy link
Copy Markdown

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 is a large modernization pass: it rewrites the Zi loader (lib/zsh/init.zsh) to use XDG paths and cleaner helper functions, refactors the install.sh / install_zpmod.sh scripts (adding set -eu, fixing the infinite-loop MAIN wrapper, delegating zpmod to a dedicated script), introduces a new sync-init.sh drift checker plus a POSIX test harness (tests/installers.sh), modernizes all CI workflows (pinned action SHAs, explicit permissions:/concurrency:, repo-rename to z-shell/src, XDG-aware paths), removes obsolete workflows and helper configs, and adds maintenance scripts (sync-labels.sh, add-project-workflow.sh).

Changes:

  • Loader/installer refactor with XDG-compliant paths, branch override via ZI[STREAM], and removal of legacy install_alpha.sh / i.sh.
  • New sync-init.sh plus tests/installers.sh test harness wired into Linux/macOS/Windows CI; updated checksum manifest.
  • CI/workflow hygiene: SHA-pinned actions, permissions, concurrency, repository-name guards, removal of rebase/stale/sync-labels/wrangler workflows.

Reviewed changes

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

Show a summary per file
File Description
lib/sh/install.sh Rewrites installer to use XDG paths, delegates zpmod build to install_zpmod.sh, removes infinite while loop.
lib/sh/install_zpmod.sh Adds POSIX _zi_ver_ge version compare, XDG dir resolution, normalized exit codes.
lib/sh/sync-init.sh New script verifying/syncing local init.zsh against canonical remote with checksum check.
lib/zsh/init.zsh Rewritten loader: XDG paths, internal _zi_* helpers, history defaults, cleaner bootstrap.
lib/sh/install_alpha.sh, lib/sh/i.sh Deleted obsolete installer variants.
lib/checksum.txt Regenerated for new script set, adds sync-init.sh.
lib/index.html New CDN landing page.
tests/installers.sh New shell test harness validating syntax, checksums, install flows, sync-init.
scripts/sync-labels.sh, scripts/add-project-workflow.sh, scripts/repos.txt New org-wide maintenance helpers.
docs/README.md Updated URLs and adds sync-init maintainer docs.
.github/workflows/check-linux.yml, check-macos.yml, win-install.yml Add tests/init paths, pin actions, XDG paths in cleanup, new smoke tests.
.github/workflows/checksum.yml, deploy-gh-pages.yml, rclone-action.yml Add permissions/concurrency, repo guards, prepare-metadata step, pinned actions.
.github/workflows/rebase-action.yml, stale-action.yml, sync-labels.yml, wrangler.yml Removed obsolete workflows.
.trunk/trunk.yaml Bumped tool versions, added shfmt definition, renamed repo to src.
.cspell/* Removed obsolete custom dictionaries.
.editorconfig, .vscode/settings.json Deleted.
.gitignore Ignores AI-agent instruction files.

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

Comment thread lib/sh/install.sh
printf '%s\n' "${col_error}-- Zsh version 5.8.1 and above required --${col_rst}"
exit 1
_zpmod_sh="${WORKDIR}/install_zpmod.sh"
_zpmod_url="https://raw.githubusercontent.com/z-shell/zi-src/main/lib/sh/install_zpmod.sh"
Comment thread lib/sh/sync-init.sh
Comment on lines +32 to +33
DEFAULT_REMOTE="https://raw.githubusercontent.com/z-shell/zi-src/main/lib/zsh/init.zsh"
DEFAULT_CHECKSUM_URL="https://raw.githubusercontent.com/z-shell/zi-src/main/lib/checksum.txt"
Comment thread lib/sh/install.sh
command git clean -d -f -f
command git reset --hard HEAD
command git pull -q origin HEAD
command git pull -q origin "${BOPT}"
Comment thread lib/sh/install_zpmod.sh
export LD_LIBRARY_PATH="${INSTALL_PATH}"/lib:"${LD_LIBRARY_PATH}"
export CFLAGS=-I"${INSTALL_PATH}"/include
export CPPFLAGS="-I${INSTALL_PATH}/include" LDFLAGS="-L${INSTALL_PATH}/lib"
export LD_LIBRARY_PATH="${INSTALL_PATH}/lib:${LD_LIBRARY_PATH-}"
Comment on lines +64 to +65
tmpdir=$(mktemp -d)
trap 'rm -rf "$tmpdir"' EXIT INT TERM
Comment thread lib/zsh/init.zsh
# History defaults
: ${HISTFILE:=${XDG_STATE_HOME:-$HOME/.local/state}/zsh/history}
[[ -e "$HISTFILE" ]] || { command mkdir -p "${HISTFILE:h}"; command touch "$HISTFILE"; }
[[ -w "$HISTFILE" ]] && typeset -gx SAVEHIST=440000 HISTSIZE=441000
Comment thread lib/sh/install.sh
ZOPT='skip'
fi
if [ "${ZOPT}" != skip ]; then
if [ "${ZOPT}" != skip ] && [ "${AOPT}" != loader ]; then
Comment thread docs/README.md
- https://ipfs.zshell.dev
- jsDeliver:
- https://cdn.jsdelivr.net/gh/z-shell/zi-src@main/
- https://cdn.jsdelivr.net/gh/z-shell/src@main/
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