From 140c5779ebef5c93e01ee051146b391d2790369c Mon Sep 17 00:00:00 2001 From: stephenleo Date: Sat, 28 Mar 2026 18:38:58 +0800 Subject: [PATCH 1/3] feat(ci): add Windows to CI and release pipeline Add windows-latest to the ci.yml and release.yml test matrices, and add x86_64-pc-windows-msvc and aarch64-pc-windows-msvc build targets to release.yml. Update Rename/Validate binary steps to handle .exe suffix on Windows; use glob upload path so both Linux and Windows assets are picked up correctly. Co-Authored-By: Claude Sonnet 4.6 --- .github/workflows/ci.yml | 2 +- .github/workflows/release.yml | 20 +++++++++++++++----- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0b0dc99..ab27af4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,7 +12,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-latest, macos-latest] + os: [ubuntu-latest, macos-latest, windows-latest] steps: - uses: actions/checkout@v4 - name: Install Rust stable diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index edf4f36..1a3dbcd 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -56,7 +56,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-latest, macos-latest] + os: [ubuntu-latest, macos-latest, windows-latest] steps: - uses: actions/checkout@v4 - name: Install Rust stable @@ -86,6 +86,10 @@ jobs: runner: ubuntu-latest - target: aarch64-unknown-linux-musl runner: ubuntu-24.04-arm + - target: x86_64-pc-windows-msvc + runner: windows-latest + - target: aarch64-pc-windows-msvc + runner: windows-11-arm steps: - uses: actions/checkout@v4 - name: Install Rust stable @@ -99,15 +103,21 @@ jobs: - name: Build release binary run: cargo build --release --target ${{ matrix.target }} - name: Rename binary - run: cp target/${{ matrix.target }}/release/cship cship-${{ matrix.target }} + shell: bash + run: | + EXT="" + if [[ "${{ matrix.target }}" == *windows* ]]; then EXT=".exe"; fi + cp "target/${{ matrix.target }}/release/cship${EXT}" "cship-${{ matrix.target }}${EXT}" - name: Validate binary + shell: bash run: | - file cship-${{ matrix.target }} - test -s cship-${{ matrix.target }} || { echo "ERROR: binary is empty"; exit 1; } + EXT="" + if [[ "${{ matrix.target }}" == *windows* ]]; then EXT=".exe"; fi + test -s "cship-${{ matrix.target }}${EXT}" || { echo "ERROR: binary is empty"; exit 1; } - uses: actions/upload-artifact@v4 with: name: cship-${{ matrix.target }} - path: cship-${{ matrix.target }} + path: cship-${{ matrix.target }}* release: name: Publish GitHub Release From c2b6884d9ed006a3f1e42bd3e2668bb55e953c0b Mon Sep 17 00:00:00 2001 From: stephenleo Date: Sat, 28 Mar 2026 18:41:37 +0800 Subject: [PATCH 2/3] fix(release): restore file command for non-Windows binary validation The original change removed the `file` validation command for all targets when it only needed to be skipped on Windows (where `file` is unavailable). This restores it conditionally for Linux/macOS to catch cross-compilation architecture mismatches. Co-Authored-By: Claude Sonnet 4.6 --- .github/workflows/release.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1a3dbcd..77d5fdf 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -113,6 +113,7 @@ jobs: run: | EXT="" if [[ "${{ matrix.target }}" == *windows* ]]; then EXT=".exe"; fi + if [[ "${{ matrix.target }}" != *windows* ]]; then file "cship-${{ matrix.target }}"; fi test -s "cship-${{ matrix.target }}${EXT}" || { echo "ERROR: binary is empty"; exit 1; } - uses: actions/upload-artifact@v4 with: From 5e2a98b7e70014070798251474d5110dfe182138 Mon Sep 17 00:00:00 2001 From: stephenleo Date: Sat, 28 Mar 2026 18:48:52 +0800 Subject: [PATCH 3/3] fix(ci): guard test_remove_statusline_present as non-Windows only MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On Windows the function uses APPDATA instead of HOME to locate settings.json, so the non-APPDATA test was writing the file to the wrong path and always hitting the "not found — skipping" branch. Windows-specific behaviour is already covered by test_remove_statusline_uses_appdata_on_windows. Co-Authored-By: Claude Sonnet 4.6 --- src/uninstall.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/uninstall.rs b/src/uninstall.rs index 915bf77..ef5c363 100644 --- a/src/uninstall.rs +++ b/src/uninstall.rs @@ -203,6 +203,7 @@ mod tests { } #[test] + #[cfg(not(target_os = "windows"))] fn test_remove_statusline_present() { with_tempdir(|home| { let claude_dir = home.join(".claude");