@sigit / si Mirror · read-only / commits / 28b657d
Fork 0

Mirror of github.com/getsigit/si.

Mirrored from https://github.com/getsigit/si.git

Synced Nov 24, 08:15 UTC

Add GitHub Releases, npm and PyPI release channels

Three workflows fire from the same vX.Y.Z tag as the existing ones and are independent and idempotent: - release-github.yml attaches si-<platform> binaries with .sha256 sidecars. - release-npm.yml publishes @getsigit/si and six @getsigit/si-<os>-<arch> packages with trusted publishing and provenance. - release-pypi.yml publishes sigit-si-cli wheels and an sdist, after a smoke test that installs each wheel and runs si --version. The npm launcher package.json carries its own copy of the version, so verify-version in release-npm.yml fails when it differs from the tag. CI now typechecks the launcher and builds a wheel on pull requests. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

Seto Elkahfi committed Nov 9, 2026 at 16:02 UTC 28b657d81dd96b24f6d6d7d8431c06c1909df1e4
18 files changed +1179 -5
.github/workflows/ci.yml
+42
@@ -36,3 +36,45 @@ jobs:
36
37 - name: Test
38 run: cargo test --workspace
39 +
40 + # Packaging breakage should show up on the pull request, not on the tag.
41 + npm-launcher:
42 + name: npm launcher typecheck
43 + runs-on: ubuntu-latest
44 + steps:
45 + - uses: actions/checkout@v4
46 +
47 + - uses: actions/setup-node@v4
48 + with:
49 + node-version-file: .nvmrc
50 +
51 + - name: Build the launcher
52 + working-directory: packaging/npm/si
53 + run: |
54 + npm ci
55 + npm run build
56 +
57 + pypi-wheel:
58 + name: PyPI wheel build
59 + runs-on: ubuntu-latest
60 + steps:
61 + - uses: actions/checkout@v4
62 +
63 + - name: Read Rust toolchain
64 + shell: bash
65 + run: |
66 + rust_toolchain="$(sed -n 's/^channel = "\(.*\)"/\1/p' rust-toolchain.toml | head -n 1)"
67 + echo "RUST_TOOLCHAIN=${rust_toolchain}" >> "$GITHUB_ENV"
68 +
69 + - uses: dtolnay/rust-toolchain@stable
70 + with:
71 + toolchain: ${{ env.RUST_TOOLCHAIN }}
72 +
73 + - uses: Swatinem/rust-cache@v2
74 +
75 + - name: Build wheel
76 + uses: PyO3/maturin-action@v1
77 + with:
78 + manylinux: "off"
79 + working-directory: packaging/pypi/si
80 + args: --release --locked --out dist
.github/workflows/release-github.yml new
+169
@@ -0,0 +1,169 @@
1 +name: Release GitHub
2 +
3 +# Attaches the prebuilt `si` binaries, each with a .sha256 sidecar, to the GitHub release for the
4 +# tag, so Homebrew, Scoop or winget can be added later without rebuilding. Re-running overwrites
5 +# the assets on the same release, so a re-pushed or re-dispatched tag is harmless.
6 +
7 +on:
8 + push:
9 + tags:
10 + - "v*.*.*"
11 + workflow_dispatch:
12 + inputs:
13 + tag:
14 + description: "Release tag (e.g. v1.3.0)"
15 + required: true
16 +
17 +concurrency:
18 + group: ${{ github.workflow }}-${{ github.event.inputs.tag || github.ref_name }}
19 + cancel-in-progress: false
20 +
21 +permissions:
22 + contents: read
23 +
24 +env:
25 + CARGO_TERM_COLOR: always
26 +
27 +jobs:
28 + verify-version:
29 + runs-on: ubuntu-latest
30 + steps:
31 + - uses: actions/checkout@v6
32 + with:
33 + ref: ${{ github.event.inputs.tag || github.ref }}
34 + - name: Tag matches the workspace version
35 + shell: bash
36 + env:
37 + TAG: ${{ github.event.inputs.tag || github.ref_name }}
38 + run: |
39 + workspace=$(sed -n 's/^version = "\(.*\)"/\1/p' Cargo.toml | head -1)
40 + if [ "$TAG" != "v$workspace" ]; then
41 + echo "::error::tag $TAG does not match the workspace version $workspace"
42 + exit 1
43 + fi
44 +
45 + build:
46 + name: Build binary (${{ matrix.build.NAME }})
47 + needs: verify-version
48 + runs-on: ${{ matrix.build.OS }}
49 + strategy:
50 + fail-fast: false
51 + matrix:
52 + build:
53 + - {
54 + NAME: linux-x64,
55 + OS: ubuntu-22.04,
56 + TARGET: x86_64-unknown-linux-gnu,
57 + }
58 + - {
59 + NAME: linux-arm64,
60 + OS: ubuntu-22.04-arm,
61 + TARGET: aarch64-unknown-linux-gnu,
62 + }
63 + - {
64 + NAME: windows-x64,
65 + OS: windows-2022,
66 + TARGET: x86_64-pc-windows-msvc,
67 + }
68 + - {
69 + NAME: windows-arm64,
70 + OS: windows-2022,
71 + TARGET: aarch64-pc-windows-msvc,
72 + }
73 + - { NAME: darwin-x64, OS: macos-26, TARGET: x86_64-apple-darwin }
74 + - { NAME: darwin-arm64, OS: macos-26, TARGET: aarch64-apple-darwin }
75 + steps:
76 + - name: Checkout
77 + uses: actions/checkout@v6
78 + with:
79 + ref: ${{ github.event.inputs.tag || github.ref }}
80 +
81 + - name: Read Rust toolchain
82 + shell: bash
83 + run: |
84 + rust_toolchain="$(sed -n 's/^channel = "\(.*\)"/\1/p' rust-toolchain.toml | head -n 1)"
85 + if [ -z "$rust_toolchain" ]; then
86 + echo "Failed to read Rust toolchain from rust-toolchain.toml" >&2
87 + exit 1
88 + fi
89 + echo "RUST_TOOLCHAIN=${rust_toolchain}" >> "$GITHUB_ENV"
90 +
91 + - name: Install Rust toolchain
92 + uses: dtolnay/rust-toolchain@3c5f7ea28cd621ae0bf5283f0e981fb97b8a7af9
93 + with:
94 + toolchain: ${{ env.RUST_TOOLCHAIN }}
95 +
96 + - name: Install Rust target
97 + shell: bash
98 + run: |
99 + rustup target add ${{ matrix.build.TARGET }} --toolchain ${{ env.RUST_TOOLCHAIN }}
100 + rustup target list --installed
101 +
102 + - name: Setup Rust cache
103 + uses: Swatinem/rust-cache@v2
104 + with:
105 + key: github-${{ matrix.build.TARGET }}
106 +
107 + # Linux builds on the oldest runner image for its glibc floor (2.35). The repo uses rustls,
108 + # so there is no OpenSSL to link or vendor.
109 + - name: Build binary
110 + shell: bash
111 + run: cargo build --locked --release -p sigit-si-cli --bin si --target ${{ matrix.build.TARGET }}
112 +
113 + # The exe must not import the VC++ runtime DLLs (see .cargo/config.toml), or it fails to
114 + # load on a machine without the redistributable.
115 + - name: Check static CRT
116 + if: contains(matrix.build.TARGET, 'windows')
117 + shell: pwsh
118 + run: ./packaging/windows/check-static-crt.ps1 -Path target/${{ matrix.build.TARGET }}/release/si.exe
119 +
120 + # Windows runners use bash from Git for Windows, which has sha256sum; macOS only has shasum.
121 + - name: Package binary and checksum
122 + shell: bash
123 + env:
124 + BUILD_NAME: ${{ matrix.build.NAME }}
125 + TARGET: ${{ matrix.build.TARGET }}
126 + run: |
127 + suffix=""
128 + if [[ "${BUILD_NAME}" == windows-* ]]; then
129 + suffix=".exe"
130 + fi
131 +
132 + mkdir -p release
133 + asset="si-${BUILD_NAME}${suffix}"
134 + cp "target/${TARGET}/release/si${suffix}" "release/${asset}"
135 +
136 + cd release
137 + if command -v sha256sum >/dev/null 2>&1; then
138 + sha256sum "${asset}" | awk '{print $1}' > "${asset}.sha256"
139 + else
140 + shasum -a 256 "${asset}" | awk '{print $1}' > "${asset}.sha256"
141 + fi
142 + echo "${asset}: $(cat "${asset}.sha256")"
143 +
144 + - name: Upload binary artifact
145 + uses: actions/upload-artifact@v4
146 + with:
147 + name: github-binary-${{ matrix.build.NAME }}
148 + path: release/*
149 +
150 + release:
151 + name: Create GitHub release
152 + needs: build
153 + runs-on: ubuntu-latest
154 + permissions:
155 + contents: write
156 + steps:
157 + - name: Download binary artifacts
158 + uses: actions/download-artifact@v4
159 + with:
160 + pattern: github-binary-*
161 + path: release
162 + merge-multiple: true
163 +
164 + - name: Release
165 + uses: softprops/action-gh-release@v2
166 + with:
167 + tag_name: ${{ github.event.inputs.tag || github.ref_name }}
168 + files: release/*
169 + generate_release_notes: true
.github/workflows/release-npm.yml new
+280
@@ -0,0 +1,280 @@
1 +name: Release npm
2 +
3 +# Publishes @getsigit/si, a launcher that resolves the native `si` binary from one of six
4 +# platform packages (@getsigit/si-<os>-<arch>), on the same tag that release-crates.yml
5 +# publishes from.
6 +#
7 +# Auth is npm Trusted Publishing (OIDC), so no token is stored. Each of the seven packages needs
8 +# a trusted publisher for this repository and workflow (release-npm.yml). `npm trust` only works
9 +# on a package that already exists, so the first version of each is published by hand.
10 +
11 +on:
12 + push:
13 + tags:
14 + - "v*.*.*"
15 + workflow_dispatch:
16 + inputs:
17 + tag:
18 + description: "Release tag (e.g. v1.3.0)"
19 + required: true
20 +
21 +concurrency:
22 + group: ${{ github.workflow }}-${{ github.event.inputs.tag || github.ref_name }}
23 + cancel-in-progress: false
24 +
25 +permissions:
26 + contents: read
27 +
28 +env:
29 + CARGO_TERM_COLOR: always
30 +
31 +jobs:
32 + # The binary reports CARGO_PKG_VERSION, and the launcher package.json carries its own copy of
33 + # the version, so both must agree with the tag.
34 + verify-version:
35 + runs-on: ubuntu-latest
36 + steps:
37 + - uses: actions/checkout@v6
38 + with:
39 + ref: ${{ github.event.inputs.tag || github.ref }}
40 + - name: Tag matches the workspace and npm package versions
41 + shell: bash
42 + env:
43 + TAG: ${{ github.event.inputs.tag || github.ref_name }}
44 + run: |
45 + workspace=$(sed -n 's/^version = "\(.*\)"/\1/p' Cargo.toml | head -1)
46 + if [ "$TAG" != "v$workspace" ]; then
47 + echo "::error::tag $TAG does not match the workspace version $workspace"
48 + exit 1
49 + fi
50 +
51 + npm_version=$(node -p "require('./packaging/npm/si/package.json').version")
52 + if [ "$TAG" != "v$npm_version" ]; then
53 + echo "::error::tag $TAG does not match packaging/npm/si/package.json version $npm_version. Bump it (and its lockfile) with the workspace version."
54 + exit 1
55 + fi
56 +
57 + publish-npm-binaries:
58 + name: Publish @getsigit/si-${{ matrix.build.NAME }}
59 + needs: verify-version
60 + runs-on: ${{ matrix.build.OS }}
61 + permissions:
62 + contents: read
63 + id-token: write
64 + strategy:
65 + fail-fast: false
66 + matrix:
67 + build:
68 + - {
69 + NAME: linux-x64,
70 + OS: ubuntu-22.04,
71 + TARGET: x86_64-unknown-linux-gnu,
72 + NODE_OS: linux,
73 + NODE_ARCH: x64,
74 + }
75 + - {
76 + NAME: linux-arm64,
77 + OS: ubuntu-22.04-arm,
78 + TARGET: aarch64-unknown-linux-gnu,
79 + NODE_OS: linux,
80 + NODE_ARCH: arm64,
81 + }
82 + - {
83 + NAME: windows-x64,
84 + OS: windows-2022,
85 + TARGET: x86_64-pc-windows-msvc,
86 + NODE_OS: win32,
87 + NODE_ARCH: x64,
88 + }
89 + - {
90 + NAME: windows-arm64,
91 + OS: windows-2022,
92 + TARGET: aarch64-pc-windows-msvc,
93 + NODE_OS: win32,
94 + NODE_ARCH: arm64,
95 + }
96 + - {
97 + NAME: darwin-x64,
98 + OS: macos-26,
99 + TARGET: x86_64-apple-darwin,
100 + NODE_OS: darwin,
101 + NODE_ARCH: x64,
102 + }
103 + - {
104 + NAME: darwin-arm64,
105 + OS: macos-26,
106 + TARGET: aarch64-apple-darwin,
107 + NODE_OS: darwin,
108 + NODE_ARCH: arm64,
109 + }
110 + steps:
111 + - name: Checkout
112 + uses: actions/checkout@v6
113 + with:
114 + ref: ${{ github.event.inputs.tag || github.ref }}
115 +
116 + - name: Set the release version
117 + shell: bash
118 + run: |
119 + release_version="${{ github.event.inputs.tag || github.ref_name }}"
120 + echo "RELEASE_VERSION=${release_version#v}" >> "$GITHUB_ENV"
121 +
122 + - name: Read Rust toolchain
123 + shell: bash
124 + run: |
125 + rust_toolchain="$(sed -n 's/^channel = "\(.*\)"/\1/p' rust-toolchain.toml | head -n 1)"
126 + if [ -z "$rust_toolchain" ]; then
127 + echo "Failed to read Rust toolchain from rust-toolchain.toml" >&2
128 + exit 1
129 + fi
130 + echo "RUST_TOOLCHAIN=${rust_toolchain}" >> "$GITHUB_ENV"
131 +
132 + - name: Install Rust toolchain
133 + uses: dtolnay/rust-toolchain@3c5f7ea28cd621ae0bf5283f0e981fb97b8a7af9
134 + with:
135 + toolchain: ${{ env.RUST_TOOLCHAIN }}
136 +
137 + - name: Install Rust target
138 + shell: bash
139 + run: |
140 + rustup target add ${{ matrix.build.TARGET }} --toolchain ${{ env.RUST_TOOLCHAIN }}
141 + rustup target list --installed
142 +
143 + - name: Setup Rust cache
144 + uses: Swatinem/rust-cache@v2
145 + with:
146 + key: npm-${{ matrix.build.TARGET }}
147 +
148 + # Linux builds on the oldest runner image for its glibc floor (2.35). The repo uses rustls,
149 + # so there is no OpenSSL to link or vendor.
150 + - name: Build binary
151 + shell: bash
152 + run: cargo build --locked --release -p sigit-si-cli --bin si --target ${{ matrix.build.TARGET }}
153 +
154 + # The exe must not import the VC++ runtime DLLs (see .cargo/config.toml), or it fails to
155 + # load on a machine without the redistributable.
156 + - name: Check static CRT
157 + if: contains(matrix.build.TARGET, 'windows')
158 + shell: pwsh
159 + run: ./packaging/windows/check-static-crt.ps1 -Path target/${{ matrix.build.TARGET }}/release/si.exe
160 +
161 + - name: Install Node
162 + uses: actions/setup-node@v6
163 + with:
164 + node-version-file: .nvmrc
165 + registry-url: "https://registry.npmjs.org"
166 +
167 + - name: Render the platform package
168 + shell: bash
169 + env:
170 + BUILD_NAME: ${{ matrix.build.NAME }}
171 + TARGET: ${{ matrix.build.TARGET }}
172 + NODE_OS: ${{ matrix.build.NODE_OS }}
173 + NODE_ARCH: ${{ matrix.build.NODE_ARCH }}
174 + run: |
175 + package_directory="si-${BUILD_NAME}"
176 + executable_name="si"
177 + if [[ "${BUILD_NAME}" == windows-* ]]; then
178 + executable_name="si.exe"
179 + fi
180 +
181 + mkdir -p "packaging/npm/${package_directory}/bin"
182 + node packaging/npm/scripts/render-platform-package.cjs \
183 + "${package_directory}" "${RELEASE_VERSION}" "${NODE_OS}" "${NODE_ARCH}"
184 + cp "target/${TARGET}/release/${executable_name}" "packaging/npm/${package_directory}/bin/"
185 +
186 + - name: Check whether the package version already exists on npm
187 + id: npm-check
188 + shell: bash
189 + env:
190 + BUILD_NAME: ${{ matrix.build.NAME }}
191 + run: |
192 + # A 404 means this version is not on npm yet. Anything other than 200 or 404 is an
193 + # outage or a block, which must not read as "not published yet".
194 + status=$(curl -sS -o /dev/null -w '%{http_code}' \
195 + --retry 3 --retry-delay 2 --retry-all-errors \
196 + "https://registry.npmjs.org/@getsigit%2Fsi-${BUILD_NAME}/${RELEASE_VERSION}")
197 +
198 + case "$status" in
199 + 200)
200 + echo "@getsigit/si-${BUILD_NAME}@${RELEASE_VERSION} already exists on npm, skipping publish"
201 + echo "exists=true" >> "$GITHUB_OUTPUT"
202 + ;;
203 + 404)
204 + echo "exists=false" >> "$GITHUB_OUTPUT"
205 + ;;
206 + *)
207 + echo "Unexpected ${status} from npm while checking @getsigit/si-${BUILD_NAME}@${RELEASE_VERSION}" >&2
208 + exit 1
209 + ;;
210 + esac
211 +
212 + - name: Publish to npm
213 + if: steps.npm-check.outputs.exists != 'true'
214 + shell: bash
215 + env:
216 + BUILD_NAME: ${{ matrix.build.NAME }}
217 + run: |
218 + cd "packaging/npm/si-${BUILD_NAME}"
219 + npm publish --access public --provenance
220 +
221 + publish-npm-base:
222 + name: Publish @getsigit/si
223 + needs: publish-npm-binaries
224 + runs-on: ubuntu-latest
225 + permissions:
226 + contents: read
227 + id-token: write
228 + steps:
229 + - name: Checkout
230 + uses: actions/checkout@v6
231 + with:
232 + ref: ${{ github.event.inputs.tag || github.ref }}
233 +
234 + - name: Set the release version
235 + shell: bash
236 + run: |
237 + release_version="${{ github.event.inputs.tag || github.ref_name }}"
238 + echo "RELEASE_VERSION=${release_version#v}" >> "$GITHUB_ENV"
239 +
240 + - name: Install Node
241 + uses: actions/setup-node@v6
242 + with:
243 + node-version-file: .nvmrc
244 + registry-url: "https://registry.npmjs.org"
245 +
246 + - name: Render and build the launcher
247 + shell: bash
248 + working-directory: packaging/npm/si
249 + run: |
250 + node ../scripts/render-main-package.cjs ./package.json "${RELEASE_VERSION}"
251 + npm ci
252 + npm run build
253 +
254 + - name: Check whether the package version already exists on npm
255 + id: npm-check
256 + shell: bash
257 + run: |
258 + status=$(curl -sS -o /dev/null -w '%{http_code}' \
259 + --retry 3 --retry-delay 2 --retry-all-errors \
260 + "https://registry.npmjs.org/@getsigit%2Fsi/${RELEASE_VERSION}")
261 +
262 + case "$status" in
263 + 200)
264 + echo "@getsigit/si@${RELEASE_VERSION} already exists on npm, skipping publish"
265 + echo "exists=true" >> "$GITHUB_OUTPUT"
266 + ;;
267 + 404)
268 + echo "exists=false" >> "$GITHUB_OUTPUT"
269 + ;;
270 + *)
271 + echo "Unexpected ${status} from npm while checking @getsigit/si@${RELEASE_VERSION}" >&2
272 + exit 1
273 + ;;
274 + esac
275 +
276 + - name: Publish to npm
277 + if: steps.npm-check.outputs.exists != 'true'
278 + shell: bash
279 + working-directory: packaging/npm/si
280 + run: npm publish --access public --provenance
.github/workflows/release-pypi.yml new
+247
@@ -0,0 +1,247 @@
1 +name: Release PyPI
2 +
3 +# Publishes sigit-si-cli, the native `si` binary packaged as maturin wheels, on the same tag that
4 +# release-crates.yml publishes from.
5 +#
6 +# Windows arm64 wheels are intentionally not built here. GitHub's hosted Windows runners provide
7 +# x64 Python, and maturin refuses to build an arm64 wheel when the interpreter reports win-amd64.
8 +#
9 +# Auth is PyPI Trusted Publishing (OIDC), so no API token is stored. pypi.org needs a publisher
10 +# for this repository and workflow (release-pypi.yml), with no environment. For the first release
11 +# that is a pending publisher, which creates the project on first upload.
12 +
13 +on:
14 + push:
15 + tags:
16 + - "v*.*.*"
17 + workflow_dispatch:
18 + inputs:
19 + tag:
20 + description: "Release tag (e.g. v1.3.0)"
21 + required: true
22 +
23 +concurrency:
24 + group: ${{ github.workflow }}-${{ github.event.inputs.tag || github.ref_name }}
25 + cancel-in-progress: false
26 +
27 +permissions:
28 + contents: read
29 +
30 +env:
31 + CARGO_TERM_COLOR: always
32 + PYPI_PACKAGE: sigit-si-cli
33 +
34 +jobs:
35 + verify-version:
36 + runs-on: ubuntu-latest
37 + steps:
38 + - uses: actions/checkout@v6
39 + with:
40 + ref: ${{ github.event.inputs.tag || github.ref }}
41 + - name: Tag matches the workspace version
42 + shell: bash
43 + env:
44 + TAG: ${{ github.event.inputs.tag || github.ref_name }}
45 + run: |
46 + workspace=$(sed -n 's/^version = "\(.*\)"/\1/p' Cargo.toml | head -1)
47 + if [ "$TAG" != "v$workspace" ]; then
48 + echo "::error::tag $TAG does not match the workspace version $workspace"
49 + exit 1
50 + fi
51 +
52 + build-wheels:
53 + name: Build wheel (${{ matrix.build.NAME }})
54 + needs: verify-version
55 + runs-on: ${{ matrix.build.OS }}
56 + strategy:
57 + fail-fast: false
58 + matrix:
59 + build:
60 + - {
61 + NAME: linux-x64,
62 + OS: ubuntu-22.04,
63 + TARGET: x86_64-unknown-linux-gnu,
64 + MANYLINUX: "2_28",
65 + }
66 + - {
67 + NAME: linux-arm64,
68 + OS: ubuntu-22.04-arm,
69 + TARGET: aarch64-unknown-linux-gnu,
70 + MANYLINUX: "2_28",
71 + }
72 + - {
73 + NAME: windows-x64,
74 + OS: windows-2022,
75 + TARGET: x86_64-pc-windows-msvc,
76 + }
77 + - { NAME: darwin-x64, OS: macos-26, TARGET: x86_64-apple-darwin }
78 + - { NAME: darwin-arm64, OS: macos-26, TARGET: aarch64-apple-darwin }
79 + steps:
80 + - name: Checkout
81 + uses: actions/checkout@v6
82 + with:
83 + ref: ${{ github.event.inputs.tag || github.ref }}
84 +
85 + - name: Read Rust toolchain
86 + shell: bash
87 + run: |
88 + rust_toolchain="$(sed -n 's/^channel = "\(.*\)"/\1/p' rust-toolchain.toml | head -n 1)"
89 + if [ -z "$rust_toolchain" ]; then
90 + echo "Failed to read Rust toolchain from rust-toolchain.toml" >&2
91 + exit 1
92 + fi
93 + echo "RUST_TOOLCHAIN=${rust_toolchain}" >> "$GITHUB_ENV"
94 +
95 + - name: Install Rust toolchain
96 + uses: dtolnay/rust-toolchain@3c5f7ea28cd621ae0bf5283f0e981fb97b8a7af9
97 + with:
98 + toolchain: ${{ env.RUST_TOOLCHAIN }}
99 + targets: ${{ matrix.build.TARGET }}
100 +
101 + # The repo uses rustls and a vendored libgit2, so the manylinux container needs no extra
102 + # system packages.
103 + - name: Build wheel
104 + uses: PyO3/maturin-action@v1
105 + with:
106 + target: ${{ matrix.build.TARGET }}
107 + manylinux: ${{ matrix.build.MANYLINUX || 'off' }}
108 + working-directory: packaging/pypi/si
109 + args: --release --locked --compatibility pypi --out dist
110 +
111 + - name: Upload wheel artifact
112 + uses: actions/upload-artifact@v4
113 + with:
114 + name: pypi-wheels-${{ matrix.build.NAME }}
115 + path: packaging/pypi/si/dist/*
116 +
117 + build-sdist:
118 + name: Build source distribution
119 + needs: verify-version
120 + runs-on: ubuntu-latest
121 + steps:
122 + - name: Checkout
123 + uses: actions/checkout@v6
124 + with:
125 + ref: ${{ github.event.inputs.tag || github.ref }}
126 +
127 + - name: Build sdist
128 + uses: PyO3/maturin-action@v1
129 + with:
130 + command: sdist
131 + working-directory: packaging/pypi/si
132 + args: --out dist
133 +
134 + - name: Upload sdist artifact
135 + uses: actions/upload-artifact@v4
136 + with:
137 + name: pypi-sdist
138 + path: packaging/pypi/si/dist/*
139 +
140 + # Installing from the built wheels proves the binary loads, not just that it was packed: a
141 + # missing runtime DLL or a glibc mismatch shows up here instead of on PyPI.
142 + smoke-test:
143 + name: Smoke test (${{ matrix.os }})
144 + needs:
145 + - build-wheels
146 + - build-sdist
147 + runs-on: ${{ matrix.os }}
148 + strategy:
149 + fail-fast: false
150 + matrix:
151 + os:
152 + # The oldest image, so the Linux wheel runs against the glibc floor.
153 + - ubuntu-22.04
154 + - windows-2022
155 + - macos-26
156 + steps:
157 + - name: Checkout
158 + uses: actions/checkout@v6
159 + with:
160 + ref: ${{ github.event.inputs.tag || github.ref }}
161 +
162 + - name: Set the release version
163 + shell: bash
164 + run: |
165 + release_version="${{ github.event.inputs.tag || github.ref_name }}"
166 + echo "RELEASE_VERSION=${release_version#v}" >> "$GITHUB_ENV"
167 +
168 + - name: Download distribution artifacts
169 + uses: actions/download-artifact@v4
170 + with:
171 + pattern: pypi-*
172 + path: dist
173 + merge-multiple: true
174 +
175 + # --only-binary keeps pip from falling back to the sdist, which would compile instead of
176 + # testing the wheel.
177 + - name: Install from the built wheels
178 + shell: bash
179 + run: |
180 + python -m venv .venv
181 + if [ -d .venv/Scripts ]; then bin_dir=.venv/Scripts; else bin_dir=.venv/bin; fi
182 + "${bin_dir}/python" -m pip install --no-index --only-binary :all: --find-links dist "${PYPI_PACKAGE}==${RELEASE_VERSION}"
183 + echo "SI_BIN_DIR=${bin_dir}" >> "$GITHUB_ENV"
184 +
185 + - name: Run the installed binary
186 + shell: bash
187 + run: |
188 + output="$("${SI_BIN_DIR}/si" --version)"
189 + echo "${output}"
190 + case "${output}" in
191 + *"${RELEASE_VERSION}"*) ;;
192 + *)
193 + echo "::error::si --version did not report ${RELEASE_VERSION}" >&2
194 + exit 1
195 + ;;
196 + esac
197 +
198 + publish-pypi:
199 + name: Publish to PyPI
200 + needs: smoke-test
201 + runs-on: ubuntu-latest
202 + permissions:
203 + contents: read
204 + id-token: write
205 + steps:
206 + - name: Set the release version
207 + shell: bash
208 + run: |
209 + release_version="${{ github.event.inputs.tag || github.ref_name }}"
210 + echo "RELEASE_VERSION=${release_version#v}" >> "$GITHUB_ENV"
211 +
212 + - name: Download distribution artifacts
213 + uses: actions/download-artifact@v4
214 + with:
215 + pattern: pypi-*
216 + path: dist
217 + merge-multiple: true
218 +
219 + - name: Check whether release already exists on PyPI
220 + id: pypi-check
221 + shell: bash
222 + run: |
223 + # A 404 means the project or the version is not on PyPI, so publish. Anything other than
224 + # 200 or 404 is an outage or a block, which must not read as "not published yet".
225 + status=$(curl -sS -o /dev/null -w '%{http_code}' \
226 + --retry 3 --retry-delay 2 --retry-all-errors \
227 + "https://pypi.org/pypi/${PYPI_PACKAGE}/${RELEASE_VERSION}/json")
228 +
229 + case "$status" in
230 + 200)
231 + echo "${PYPI_PACKAGE} ${RELEASE_VERSION} already exists on PyPI, skipping publish"
232 + echo "exists=true" >> "$GITHUB_OUTPUT"
233 + ;;
234 + 404)
235 + echo "exists=false" >> "$GITHUB_OUTPUT"
236 + ;;
237 + *)
238 + echo "Unexpected ${status} from PyPI while checking whether ${PYPI_PACKAGE} ${RELEASE_VERSION} is published" >&2
239 + exit 1
240 + ;;
241 + esac
242 +
243 + - name: Publish distribution
244 + if: steps.pypi-check.outputs.exists != 'true'
245 + uses: pypa/gh-action-pypi-publish@release/v1
246 + with:
247 + skip-existing: true
.gitignore
+6
@@ -14,3 +14,9 @@ packaging/nuget/**/obj/
14 packaging/nuget/**/native/
15 packaging/nuget/dist/
16 packaging/nuget/NuGet.Config
17 +
18 +# npm and PyPI packaging
19 +/packaging/npm/si-*/
20 +/packaging/npm/si/lib/
21 +/packaging/npm/si/node_modules/
22 +/packaging/pypi/*/dist/
.nvmrc new
+1
@@ -0,0 +1 @@
1 +24
README.md
+16 -5
@@ -10,13 +10,18 @@ drive Cloud Sessions, all from the terminal.
10 cargo install --path crates/cli
11 ```
12
13 -This installs a binary named `si`. On a machine with the .NET SDK there is also
14 -a prebuilt tool:
13 +This installs a binary named `si`. Prebuilt binaries are also available:
14
15 ```sh
17 -dotnet tool install --global SiGit.Cli
16 +npm install -g @getsigit/si # npm
17 +pipx install sigit-si-cli # PyPI (or: uvx --from sigit-si-cli si)
18 +dotnet tool install --global SiGit.Cli # .NET
19 ```
20
21 +Or download a binary for your platform from
22 +[GitHub Releases](https://github.com/getsigit/si/releases); each asset has a
23 +`.sha256` file next to it.
24 +
25 ## Usage
26
27 ```sh
@@ -142,11 +147,17 @@ marker can never be listed, and fixing it costs a new version. The internal
147 setup and release runbook live with the server (private `sigit-si` repo).
148
149 To cut a release, bump `[workspace.package].version` and the `sigit-si-api`
145 -dependency in the root `Cargo.toml`, merge `development` into `main`, and push a
150 +dependency in the root `Cargo.toml`, and the `version` in
151 +`packaging/npm/si/package.json` and its lockfile (`release-npm.yml` fails when
152 +it differs from the tag; PyPI and NuGet read the version from the crate), merge `development` into `main`, and push a
153 `vX.Y.Z` tag. `release-crates.yml` checks the crate versions against the tag,
154 publishes whichever of `sigit-si-api` and `sigit-si-cli` isn't on crates.io yet
155 (through Trusted Publishing, so no token is stored), then dispatches
149 -`release-mcp-registry.yml`.
156 +`release-mcp-registry.yml`. The same tag also starts `release-github.yml`
157 +(release assets with checksums), `release-npm.yml`, `release-pypi.yml` and
158 +`release-nuget.yml`. They run independently, publish through Trusted Publishing
159 +where the registry supports it, and skip a version that is already published,
160 +so any of them can be re-run on its own.
161
162 ## Development
163
packaging/npm/scripts/render-main-package.cjs new
+57
@@ -0,0 +1,57 @@
1 +#!/usr/bin/env node
2 +
3 +const fs = require("fs");
4 +const path = require("path");
5 +
6 +const [outputPath, version] = process.argv.slice(2);
7 +
8 +if (!outputPath || !version) {
9 + throw new Error("Usage: render-main-package.cjs <output-path> <version>");
10 +}
11 +
12 +// The platform binary packages the launcher resolves at runtime. Kept in lockstep with the
13 +// release-npm.yml build matrix.
14 +const platformSuffixes = [
15 + "darwin-arm64",
16 + "darwin-x64",
17 + "linux-arm64",
18 + "linux-x64",
19 + "windows-arm64",
20 + "windows-x64",
21 +];
22 +
23 +const optionalDependencies = {};
24 +for (const suffix of platformSuffixes) {
25 + optionalDependencies[`@getsigit/si-${suffix}`] = version;
26 +}
27 +
28 +const packageJson = {
29 + name: "@getsigit/si",
30 + version,
31 + // Ownership proof for the MCP Registry: must match `name` in the repo's server.json.
32 + mcpName: "si.sigit/cli",
33 + keywords: ["sigit", "si", "cli", "git", "code-review", "mcp"],
34 + bin: {
35 + si: "lib/index.js",
36 + },
37 + files: ["lib", "README.md"],
38 + description: "si, the sigit.si command line interface.",
39 + license: "Apache-2.0",
40 + homepage: "https://sigit.si",
41 + repository: {
42 + type: "git",
43 + url: "git+https://github.com/getsigit/si.git",
44 + },
45 + scripts: {
46 + typecheck: "tsc --noEmit",
47 + build: "tsc",
48 + dev: "npm run build && node lib/index.js",
49 + },
50 + devDependencies: {
51 + "@types/node": "^18.15.11",
52 + typescript: "^5.0.0",
53 + },
54 + optionalDependencies,
55 +};
56 +
57 +fs.writeFileSync(path.resolve(outputPath), `${JSON.stringify(packageJson, null, 2)}\n`);
packaging/npm/scripts/render-platform-package.cjs new
+37
@@ -0,0 +1,37 @@
1 +#!/usr/bin/env node
2 +
3 +const fs = require("fs");
4 +const path = require("path");
5 +
6 +const [packageName, version, operatingSystem, architecture] = process.argv.slice(2);
7 +
8 +if (!packageName || !version || !operatingSystem || !architecture) {
9 + throw new Error("Usage: render-platform-package.cjs <package-name> <version> <os> <arch>");
10 +}
11 +
12 +const packageDirectory = path.resolve(__dirname, "..", packageName);
13 +
14 +fs.mkdirSync(packageDirectory, { recursive: true });
15 +
16 +const packageJson = {
17 + name: `@getsigit/${packageName}`,
18 + version,
19 + description: "Platform binary for the si CLI.",
20 + license: "Apache-2.0",
21 + repository: {
22 + type: "git",
23 + url: "git+https://github.com/getsigit/si.git",
24 + },
25 + keywords: [packageName, "si", "sigit", "cli", "binary"],
26 + os: [operatingSystem],
27 + cpu: [architecture],
28 + files: ["bin"],
29 +};
30 +
31 +const readme = `# ${packageName}
32 +
33 +Not meant to be used directly. Please see [@getsigit/si](https://www.npmjs.com/package/@getsigit/si).
34 +`;
35 +
36 +fs.writeFileSync(path.join(packageDirectory, "package.json"), `${JSON.stringify(packageJson, null, 2)}\n`);
37 +fs.writeFileSync(path.join(packageDirectory, "README.md"), readme);
packaging/npm/si/.gitignore new
+2
@@ -0,0 +1,2 @@
1 +lib/
2 +node_modules/
packaging/npm/si/README.md new
+54
@@ -0,0 +1,54 @@
1 +<!-- mcp-name: si.sigit/cli -->
2 +
3 +# si for npm
4 +
5 +`si` is the command line interface for [sigit.si](https://sigit.si): sign in, manage repositories,
6 +review pull requests, triage issues, search code, and drive Cloud Sessions from the terminal.
7 +
8 +This package installs the native `si` binary for your platform. It has no JavaScript API.
9 +
10 +## Install
11 +
12 +```sh
13 +npm install -g @getsigit/si
14 +```
15 +
16 +Or run it without installing:
17 +
18 +```sh
19 +npx @getsigit/si --help
20 +```
21 +
22 +## Run
23 +
24 +```sh
25 +si auth login
26 +si repo list
27 +```
28 +
29 +## Platform support
30 +
31 +The binary comes from an optional dependency that npm selects for your machine:
32 +
33 +- macOS `arm64`, `x64`
34 +- Linux `arm64`, `x64` (glibc)
35 +- Windows `arm64`, `x64`
36 +
37 +Installing with `--omit=optional` leaves the binary out, and `si` then fails with a message saying so.
38 +
39 +## Other installation methods
40 +
41 +- Cargo: `cargo install sigit-si-cli`
42 +- PyPI: `pipx install sigit-si-cli`
43 +- .NET: `dotnet tool install --global SiGit.Cli`
44 +- Prebuilt binaries: [GitHub Releases](https://github.com/getsigit/si/releases)
45 +
46 +## Source
47 +
48 +- Repository: <https://github.com/getsigit/si>
49 +- Website: <https://sigit.si>
50 +- Issues: <https://github.com/getsigit/si/issues>
51 +
52 +## License
53 +
54 +[Apache 2.0](https://github.com/getsigit/si/blob/main/LICENSE)
packaging/npm/si/package-lock.json new
+77
@@ -0,0 +1,77 @@
1 +{
2 + "name": "@getsigit/si",
3 + "version": "1.3.1",
4 + "lockfileVersion": 3,
5 + "requires": true,
6 + "packages": {
7 + "": {
8 + "name": "@getsigit/si",
9 + "version": "1.3.1",
10 + "license": "Apache-2.0",
11 + "bin": {
12 + "si": "lib/index.js"
13 + },
14 + "devDependencies": {
15 + "@types/node": "^18.15.11",
16 + "typescript": "^5.0.0"
17 + },
18 + "optionalDependencies": {
19 + "@getsigit/si-darwin-arm64": "1.3.1",
20 + "@getsigit/si-darwin-x64": "1.3.1",
21 + "@getsigit/si-linux-arm64": "1.3.1",
22 + "@getsigit/si-linux-x64": "1.3.1",
23 + "@getsigit/si-windows-arm64": "1.3.1",
24 + "@getsigit/si-windows-x64": "1.3.1"
25 + }
26 + },
27 + "node_modules/@getsigit/si-darwin-arm64": {
28 + "optional": true
29 + },
30 + "node_modules/@getsigit/si-darwin-x64": {
31 + "optional": true
32 + },
33 + "node_modules/@getsigit/si-linux-arm64": {
34 + "optional": true
35 + },
36 + "node_modules/@getsigit/si-linux-x64": {
37 + "optional": true
38 + },
39 + "node_modules/@getsigit/si-windows-arm64": {
40 + "optional": true
41 + },
42 + "node_modules/@getsigit/si-windows-x64": {
43 + "optional": true
44 + },
45 + "node_modules/@types/node": {
46 + "version": "18.19.130",
47 + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.19.130.tgz",
48 + "integrity": "sha512-GRaXQx6jGfL8sKfaIDD6OupbIHBr9jv7Jnaml9tB7l4v068PAOXqfcujMMo5PhbIs6ggR1XODELqahT2R8v0fg==",
49 + "dev": true,
50 + "license": "MIT",
51 + "dependencies": {
52 + "undici-types": "~5.26.4"
53 + }
54 + },
55 + "node_modules/typescript": {
56 + "version": "5.9.3",
57 + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz",
58 + "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==",
59 + "dev": true,
60 + "license": "Apache-2.0",
61 + "bin": {
62 + "tsc": "bin/tsc",
63 + "tsserver": "bin/tsserver"
64 + },
65 + "engines": {
66 + "node": ">=14.17"
67 + }
68 + },
69 + "node_modules/undici-types": {
70 + "version": "5.26.5",
71 + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz",
72 + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==",
73 + "dev": true,
74 + "license": "MIT"
75 + }
76 + }
77 +}
packaging/npm/si/package.json new
+44
@@ -0,0 +1,44 @@
1 +{
2 + "name": "@getsigit/si",
3 + "version": "1.3.1",
4 + "mcpName": "si.sigit/cli",
5 + "keywords": [
6 + "sigit",
7 + "si",
8 + "cli",
9 + "git",
10 + "code-review",
11 + "mcp"
12 + ],
13 + "bin": {
14 + "si": "lib/index.js"
15 + },
16 + "files": [
17 + "lib",
18 + "README.md"
19 + ],
20 + "description": "si, the sigit.si command line interface.",
21 + "license": "Apache-2.0",
22 + "homepage": "https://sigit.si",
23 + "repository": {
24 + "type": "git",
25 + "url": "git+https://github.com/getsigit/si.git"
26 + },
27 + "scripts": {
28 + "typecheck": "tsc --noEmit",
29 + "build": "tsc",
30 + "dev": "npm run build && node lib/index.js"
31 + },
32 + "devDependencies": {
33 + "@types/node": "^18.15.11",
34 + "typescript": "^5.0.0"
35 + },
36 + "optionalDependencies": {
37 + "@getsigit/si-darwin-arm64": "1.3.1",
38 + "@getsigit/si-darwin-x64": "1.3.1",
39 + "@getsigit/si-linux-arm64": "1.3.1",
40 + "@getsigit/si-linux-x64": "1.3.1",
41 + "@getsigit/si-windows-arm64": "1.3.1",
42 + "@getsigit/si-windows-x64": "1.3.1"
43 + }
44 +}
packaging/npm/si/src/index.ts new
+44
@@ -0,0 +1,44 @@
1 +#!/usr/bin/env node
2 +
3 +import { spawnSync } from "child_process";
4 +
5 +/**
6 + * Resolves the native binary from the platform package npm installed next to this one.
7 + * The package is named `@getsigit/si-${os}-${arch}`, with `win32` mapped to `windows`.
8 + * @see https://nodejs.org/api/os.html#osarch
9 + * @see https://nodejs.org/api/os.html#osplatform
10 + */
11 +function getExePath(): string {
12 + const arch = process.arch;
13 + let os = process.platform as string;
14 + let extension = "";
15 + if (["win32", "cygwin"].includes(process.platform)) {
16 + os = "windows";
17 + extension = ".exe";
18 + }
19 +
20 + try {
21 + return require.resolve(`@getsigit/si-${os}-${arch}/bin/si${extension}`);
22 + } catch (e) {
23 + throw new Error(
24 + `Couldn't find the si binary for ${os}-${arch} inside node_modules. ` +
25 + "Reinstall without --omit=optional, or install with `cargo install sigit-si-cli`.",
26 + );
27 + }
28 +}
29 +
30 +function run(): void {
31 + const args = process.argv.slice(2);
32 + const result = spawnSync(getExePath(), args, { stdio: "inherit" });
33 +
34 + if (result.error) {
35 + console.error(`Failed to run si: ${result.error.message}`);
36 + process.exit(1);
37 + }
38 +
39 + // `status` is null when the child was killed by a signal; report that as a failure rather
40 + // than as success.
41 + process.exit(result.status ?? 1);
42 +}
43 +
44 +run();
packaging/npm/si/tsconfig.json new
+12
@@ -0,0 +1,12 @@
1 +{
2 + "compilerOptions": {
3 + "target": "es2016",
4 + "module": "commonjs",
5 + "esModuleInterop": true,
6 + "baseUrl": "./",
7 + "outDir": "lib",
8 + "forceConsistentCasingInFileNames": true,
9 + "strict": true,
10 + "skipLibCheck": true
11 + }
12 +}
packaging/nuget/si/README.md
+3
@@ -36,6 +36,9 @@ download. `cargo install sigit-si-cli` builds only for your machine.
36 ## Other installation methods
37
38 - Cargo: `cargo install sigit-si-cli`
39 +- npm: `npm install -g @getsigit/si`
40 +- PyPI: `pipx install sigit-si-cli`
41 +- Prebuilt binaries: [GitHub Releases](https://github.com/getsigit/si/releases)
42
43 ## Source
44
packaging/pypi/si/README.md new
+52
@@ -0,0 +1,52 @@
1 +# si for Python
2 +
3 +`si` is the command line interface for [sigit.si](https://sigit.si): sign in, manage repositories,
4 +review pull requests, triage issues, search code, and drive Cloud Sessions from the terminal.
5 +
6 +This package is the native `si` binary packaged as a Python wheel. There is no Python API.
7 +
8 +## Install
9 +
10 +```sh
11 +pipx install sigit-si-cli
12 +```
13 +
14 +Or run it without installing:
15 +
16 +```sh
17 +uvx --from sigit-si-cli si --help
18 +```
19 +
20 +## Run
21 +
22 +```sh
23 +si auth login
24 +si repo list
25 +```
26 +
27 +## Platform support
28 +
29 +Prebuilt wheels cover:
30 +
31 +- macOS `arm64`, `x86_64`
32 +- Linux `arm64`, `x86_64` (glibc)
33 +- Windows `x86_64`
34 +
35 +On other platforms pip builds from the source distribution, which needs a Rust toolchain.
36 +
37 +## Other installation methods
38 +
39 +- Cargo: `cargo install sigit-si-cli`
40 +- npm: `npm install -g @getsigit/si`
41 +- .NET: `dotnet tool install --global SiGit.Cli`
42 +- Prebuilt binaries: [GitHub Releases](https://github.com/getsigit/si/releases)
43 +
44 +## Source
45 +
46 +- Repository: <https://github.com/getsigit/si>
47 +- Website: <https://sigit.si>
48 +- Issues: <https://github.com/getsigit/si/issues>
49 +
50 +## License
51 +
52 +[Apache 2.0](https://github.com/getsigit/si/blob/main/LICENSE)
packaging/pypi/si/pyproject.toml new
+36
@@ -0,0 +1,36 @@
1 +[build-system]
2 +requires = ["maturin>=1.7,<2.0"]
3 +build-backend = "maturin"
4 +
5 +[project]
6 +name = "sigit-si-cli"
7 +description = "si, the sigit.si command line interface."
8 +readme = "README.md"
9 +requires-python = ">=3.8"
10 +dynamic = ["version"]
11 +license = { text = "Apache-2.0" }
12 +authors = [{ name = "Seto Elkahfi", email = "seto@sigit.si" }]
13 +keywords = ["cli", "git", "sigit", "code-review"]
14 +classifiers = [
15 + "Development Status :: 4 - Beta",
16 + "Environment :: Console",
17 + "Intended Audience :: Developers",
18 + "License :: OSI Approved :: Apache Software License",
19 + "Operating System :: MacOS",
20 + "Operating System :: Microsoft :: Windows",
21 + "Operating System :: POSIX :: Linux",
22 + "Programming Language :: Python :: 3",
23 + "Programming Language :: Rust",
24 + "Topic :: Software Development :: Version Control :: Git",
25 + "Topic :: Utilities",
26 +]
27 +
28 +[project.urls]
29 +Homepage = "https://sigit.si"
30 +Repository = "https://github.com/getsigit/si"
31 +Issues = "https://github.com/getsigit/si/issues"
32 +
33 +[tool.maturin]
34 +manifest-path = "../../../crates/cli/Cargo.toml"
35 +bindings = "bin"
36 +strip = true