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

Mirror of github.com/getsigit/si.

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

Synced Nov 24, 08:15 UTC

Add SiGit.Cli as a NuGet .NET tool

The repo only published crates, so there was no prebuilt `si` binary. release-nuget.yml builds six targets on the v*.*.* tag, packs them into packaging/nuget/si, smoke-tests the install on three OSes, and publishes through NuGet trusted publishing. Linux builds on ubuntu-22.04 runners to keep the glibc floor low. Windows builds link the C runtime statically (.cargo/config.toml), and the workflow runs check-static-crt.ps1 so a binary that needs the VC++ redistributable fails the release instead of failing on a user's machine. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

Seto Elkahfi committed Nov 9, 2026 at 14:12 UTC eb8fca8c4191073709ec0b8c685a77d9e2e7ded7
8 files changed +641 -1
.cargo/config.toml new
+7
@@ -0,0 +1,7 @@
1 +# Link the MSVC C runtime statically on Windows. Without this the binary
2 +# imports VCRUNTIME140.dll and the UCRT api-ms-win-crt-*.dll set, and on a
3 +# machine without the Visual C++ Redistributable it dies at load time with
4 +# STATUS_DLL_NOT_FOUND (0xC0000135) before main runs. the .NET tool and any
5 +# downloaded exe have no installer to bring the runtime along.
6 +[target.'cfg(all(windows, target_env = "msvc"))']
7 +rustflags = ["-C", "target-feature=+crt-static"]
.github/workflows/release-nuget.yml new
+384
@@ -0,0 +1,384 @@
1 +name: Release NuGet
2 +
3 +# Publishes SiGit.Cli, a .NET tool that bundles the native `si` binaries, on the same tag that
4 +# release-crates.yml publishes from.
5 +#
6 +# Auth is NuGet Trusted Publishing (OIDC), so no long-lived API key is stored. nuget.org needs a
7 +# trusted publishing policy for this repository and workflow (release-nuget.yml), and the
8 +# NUGET_USER repo secret must hold the nuget.org profile name that owns the package.
9 +
10 +on:
11 + push:
12 + tags:
13 + - "v*.*.*"
14 + workflow_dispatch:
15 + inputs:
16 + tag:
17 + description: "Release tag (e.g. v1.3.0)"
18 + required: true
19 +
20 +concurrency:
21 + # A re-pushed or re-dispatched tag fires this a second time. Queue the
22 + # duplicate behind the original instead of cancelling it: cancelling a run
23 + # mid-publish can leave a channel half-uploaded, whereas a queued duplicate
24 + # just hits the "already published" check and exits clean.
25 + group: ${{ github.workflow }}-${{ github.event.inputs.tag || github.ref_name }}
26 + cancel-in-progress: false
27 +
28 +permissions:
29 + contents: read
30 +
31 +env:
32 + CARGO_TERM_COLOR: always
33 + DOTNET_VERSION: 8.0.x
34 + NUGET_PACKAGE_ID: SiGit.Cli
35 +
36 +jobs:
37 + # The binary reports CARGO_PKG_VERSION, so a tag that disagrees with the workspace version
38 + # would publish a package that lies about its version.
39 + verify-version:
40 + runs-on: ubuntu-latest
41 + steps:
42 + - uses: actions/checkout@v6
43 + with:
44 + ref: ${{ github.event.inputs.tag || github.ref }}
45 + - name: Tag matches the workspace version
46 + shell: bash
47 + env:
48 + TAG: ${{ github.event.inputs.tag || github.ref_name }}
49 + run: |
50 + workspace=$(sed -n 's/^version = "\(.*\)"/\1/p' Cargo.toml | head -1)
51 + if [ "$TAG" != "v$workspace" ]; then
52 + echo "::error::tag $TAG does not match the workspace version $workspace"
53 + exit 1
54 + fi
55 +
56 + build-native-binaries:
57 + name: Build native binary (${{ matrix.build.NAME }})
58 + needs: verify-version
59 + runs-on: ${{ matrix.build.OS }}
60 + strategy:
61 + fail-fast: false
62 + matrix:
63 + build:
64 + - {
65 + NAME: linux-x64,
66 + OS: ubuntu-22.04,
67 + TARGET: x86_64-unknown-linux-gnu,
68 + }
69 + - {
70 + NAME: linux-arm64,
71 + OS: ubuntu-22.04-arm,
72 + TARGET: aarch64-unknown-linux-gnu,
73 + }
74 + - {
75 + NAME: windows-x64,
76 + OS: windows-2022,
77 + TARGET: x86_64-pc-windows-msvc,
78 + }
79 + - {
80 + NAME: windows-arm64,
81 + OS: windows-2022,
82 + TARGET: aarch64-pc-windows-msvc,
83 + }
84 + - { NAME: darwin-x64, OS: macos-26, TARGET: x86_64-apple-darwin }
85 + - { NAME: darwin-arm64, OS: macos-26, TARGET: aarch64-apple-darwin }
86 + steps:
87 + - name: Checkout
88 + uses: actions/checkout@v6
89 + with:
90 + ref: ${{ github.event.inputs.tag || github.ref }}
91 +
92 + - name: Read Rust toolchain
93 + shell: bash
94 + run: |
95 + rust_toolchain="$(sed -n 's/^channel = "\(.*\)"/\1/p' rust-toolchain.toml | head -n 1)"
96 + if [ -z "$rust_toolchain" ]; then
97 + echo "Failed to read Rust toolchain from rust-toolchain.toml" >&2
98 + exit 1
99 + fi
100 + echo "RUST_TOOLCHAIN=${rust_toolchain}" >> "$GITHUB_ENV"
101 +
102 + - name: Install Rust toolchain
103 + uses: dtolnay/rust-toolchain@3c5f7ea28cd621ae0bf5283f0e981fb97b8a7af9
104 + with:
105 + toolchain: ${{ env.RUST_TOOLCHAIN }}
106 +
107 + - name: Install Rust target
108 + shell: bash
109 + run: |
110 + rustup target add ${{ matrix.build.TARGET }} --toolchain ${{ env.RUST_TOOLCHAIN }}
111 + rustup target list --installed
112 +
113 + - name: Setup Rust cache
114 + uses: Swatinem/rust-cache@v2
115 + with:
116 + key: nuget-${{ matrix.build.TARGET }}
117 +
118 + # Linux builds on the oldest runner image for its glibc floor (2.35). The repo uses rustls,
119 + # so there is no OpenSSL to link or vendor.
120 + - name: Build binary
121 + shell: bash
122 + run: cargo build --locked --release -p sigit-si-cli --bin si --target ${{ matrix.build.TARGET }}
123 +
124 + # The exe must not import the VC++ runtime DLLs (see .cargo/config.toml), or it fails to
125 + # load on a machine without the redistributable.
126 + - name: Check static CRT
127 + if: contains(matrix.build.TARGET, 'windows')
128 + shell: pwsh
129 + run: ./packaging/windows/check-static-crt.ps1 -Path target/${{ matrix.build.TARGET }}/release/si.exe
130 +
131 + - name: Prepare artifact
132 + shell: bash
133 + env:
134 + BUILD_NAME: ${{ matrix.build.NAME }}
135 + run: |
136 + executable_name="si"
137 + if [[ "${BUILD_NAME}" == windows-* ]]; then
138 + executable_name="si.exe"
139 + fi
140 +
141 + mkdir -p "nuget-artifacts/native/${{ matrix.build.NAME }}"
142 + cp "target/${{ matrix.build.TARGET }}/release/${executable_name}" \
143 + "nuget-artifacts/native/${{ matrix.build.NAME }}/${executable_name}"
144 +
145 + - name: Upload native artifact
146 + uses: actions/upload-artifact@v4
147 + with:
148 + name: nuget-native-${{ matrix.build.NAME }}
149 + path: nuget-artifacts/native
150 +
151 + pack-nuget:
152 + name: Pack NuGet .NET tool
153 + runs-on: ubuntu-latest
154 + needs: build-native-binaries
155 + steps:
156 + - name: Checkout
157 + uses: actions/checkout@v6
158 + with:
159 + ref: ${{ github.event.inputs.tag || github.ref }}
160 +
161 + - name: Set the release version
162 + shell: bash
163 + run: |
164 + if [[ "${GITHUB_REF_TYPE}" == "tag" ]]; then
165 + release_version="${GITHUB_REF_NAME#v}"
166 + else
167 + release_version="${{ github.event.inputs.tag }}"
168 + release_version="${release_version#v}"
169 + fi
170 + echo "RELEASE_VERSION=${release_version}" >> "$GITHUB_ENV"
171 +
172 + - name: Download native artifacts
173 + uses: actions/download-artifact@v4
174 + with:
175 + pattern: nuget-native-*
176 + path: packaging/nuget/si/native
177 + merge-multiple: true
178 +
179 + - name: Setup .NET SDK
180 + uses: actions/setup-dotnet@v4
181 + with:
182 + dotnet-version: ${{ env.DOTNET_VERSION }}
183 +
184 + - name: Pack .NET tool
185 + shell: bash
186 + run: |
187 + dotnet pack packaging/nuget/si/SiGit.Cli.csproj \
188 + --configuration Release \
189 + --output packaging/nuget/dist \
190 + -p:PackageVersion="${RELEASE_VERSION}"
191 +
192 + # All six binaries ship in one package, so this sits closer to nuget.org's
193 + # 250 MB ceiling than the single-platform npm and PyPI artifacts do. Fail
194 + # here with a clear message rather than at `dotnet nuget push`, where the
195 + # error is just "the package file exceeds the size limit".
196 + - name: Check package size against the NuGet limit
197 + shell: bash
198 + run: |
199 + package="$(find packaging/nuget/dist -name '*.nupkg' | head -n 1)"
200 + size_bytes="$(wc -c < "${package}")"
201 + limit_bytes=$((250 * 1024 * 1024))
202 +
203 + echo "Package: ${package}"
204 + echo "Size: $((size_bytes / 1024 / 1024)) MiB"
205 +
206 + if [ "${size_bytes}" -gt "${limit_bytes}" ]; then
207 + echo "::error::${package} is over nuget.org's 250 MB package limit. Split the tool into RID-specific packages (.NET 10 DotnetToolRidPackage) instead of bundling every target." >&2
208 + exit 1
209 + fi
210 +
211 + - name: Upload package artifact
212 + uses: actions/upload-artifact@v4
213 + with:
214 + name: nuget-package
215 + path: packaging/nuget/dist/*.nupkg
216 +
217 + smoke-test:
218 + name: Smoke test (${{ matrix.os }})
219 + runs-on: ${{ matrix.os }}
220 + needs: pack-nuget
221 + strategy:
222 + fail-fast: false
223 + matrix:
224 + os:
225 + - ubuntu-latest
226 + - windows-2022
227 + - macos-26
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 + if [[ "${GITHUB_REF_TYPE}" == "tag" ]]; then
238 + release_version="${GITHUB_REF_NAME#v}"
239 + else
240 + release_version="${{ github.event.inputs.tag }}"
241 + release_version="${release_version#v}"
242 + fi
243 + echo "RELEASE_VERSION=${release_version}" >> "$GITHUB_ENV"
244 +
245 + - name: Download package artifact
246 + uses: actions/download-artifact@v4
247 + with:
248 + name: nuget-package
249 + path: packaging/nuget/dist
250 +
251 + - name: Setup .NET SDK
252 + uses: actions/setup-dotnet@v4
253 + with:
254 + dotnet-version: ${{ env.DOTNET_VERSION }}
255 +
256 + - name: Install tool from local package
257 + shell: pwsh
258 + run: |
259 + $packageSource = (Resolve-Path "packaging/nuget/dist").Path
260 + @"
261 + <?xml version="1.0" encoding="utf-8"?>
262 + <configuration>
263 + <packageSources>
264 + <clear />
265 + <add key="local" value="$packageSource" />
266 + </packageSources>
267 + </configuration>
268 + "@ | Set-Content -Path "packaging/nuget/NuGet.Config"
269 +
270 + dotnet tool install `
271 + --tool-path ".tool" `
272 + --configfile "packaging/nuget/NuGet.Config" `
273 + --version "$env:RELEASE_VERSION" `
274 + "$env:NUGET_PACKAGE_ID"
275 +
276 + - name: Verify bundled native binary
277 + shell: pwsh
278 + run: |
279 + $runtimeIdentifier = if ($IsWindows) {
280 + if ([System.Runtime.InteropServices.RuntimeInformation]::ProcessArchitecture -eq [System.Runtime.InteropServices.Architecture]::Arm64) { "windows-arm64" } else { "windows-x64" }
281 + } elseif ($IsMacOS) {
282 + if ([System.Runtime.InteropServices.RuntimeInformation]::ProcessArchitecture -eq [System.Runtime.InteropServices.Architecture]::Arm64) { "darwin-arm64" } else { "darwin-x64" }
283 + } else {
284 + if ([System.Runtime.InteropServices.RuntimeInformation]::ProcessArchitecture -eq [System.Runtime.InteropServices.Architecture]::Arm64) { "linux-arm64" } else { "linux-x64" }
285 + }
286 +
287 + $binaryName = if ($IsWindows) { "si.exe" } else { "si" }
288 + $nativeBinary = Get-ChildItem ".tool/.store" -Recurse -File | Where-Object {
289 + $_.FullName -like "*native*${runtimeIdentifier}*${binaryName}"
290 + } | Select-Object -First 1
291 +
292 + if (-not $nativeBinary) {
293 + Write-Error "The si native binary for ${runtimeIdentifier} was not bundled in the installed .NET tool package."
294 + }
295 +
296 + Write-Host "Found bundled native binary at $($nativeBinary.FullName)"
297 +
298 + publish-nuget:
299 + name: Publish to NuGet
300 + runs-on: ubuntu-latest
301 + needs: smoke-test
302 + # Trusted Publishing exchanges a GitHub OIDC token for a short-lived NuGet
303 + # API key, so no long-lived NUGET_API_KEY secret is stored. Requires a
304 + # trusted publishing policy on nuget.org for this repository and workflow
305 + # (release-nuget.yml); without one the login step fails.
306 + permissions:
307 + contents: read
308 + id-token: write
309 + steps:
310 + - name: Set the release version
311 + shell: bash
312 + run: |
313 + if [[ "${GITHUB_REF_TYPE}" == "tag" ]]; then
314 + release_version="${GITHUB_REF_NAME#v}"
315 + else
316 + release_version="${{ github.event.inputs.tag }}"
317 + release_version="${release_version#v}"
318 + fi
319 + echo "RELEASE_VERSION=${release_version}" >> "$GITHUB_ENV"
320 +
321 + - name: Download package artifact
322 + uses: actions/download-artifact@v4
323 + with:
324 + name: nuget-package
325 + path: packaging/nuget/dist
326 +
327 + - name: Setup .NET SDK
328 + uses: actions/setup-dotnet@v4
329 + with:
330 + dotnet-version: ${{ env.DOTNET_VERSION }}
331 +
332 + - name: Check whether release already exists on NuGet
333 + id: nuget-check
334 + shell: bash
335 + run: |
336 + package_index_url="https://api.nuget.org/v3-flatcontainer/sigit.cli/index.json"
337 +
338 + # Keep the fetch and the version match separate. Piping curl into
339 + # grep hides a failed fetch behind an empty match, so an outage or a
340 + # blocked request would read as "not published yet" and send the
341 + # publish below into a version that is already there. A 404 here
342 + # means the package itself is not on NuGet, which is the first
343 + # release and a real "not published".
344 + index=$(mktemp)
345 + STATUS=$(curl -sS -o "${index}" -w '%{http_code}' \
346 + --retry 3 --retry-delay 2 --retry-all-errors "${package_index_url}")
347 +
348 + case "$STATUS" in
349 + 200)
350 + if grep -F "\"${RELEASE_VERSION}\"" "${index}" >/dev/null; then
351 + echo "${NUGET_PACKAGE_ID} ${RELEASE_VERSION} already exists on NuGet, skipping publish"
352 + echo "exists=true" >> "$GITHUB_OUTPUT"
353 + else
354 + echo "exists=false" >> "$GITHUB_OUTPUT"
355 + fi
356 + ;;
357 + 404)
358 + echo "${NUGET_PACKAGE_ID} is not on NuGet yet, publishing its first version"
359 + echo "exists=false" >> "$GITHUB_OUTPUT"
360 + ;;
361 + *)
362 + echo "Unexpected ${STATUS} from NuGet while checking whether ${NUGET_PACKAGE_ID} ${RELEASE_VERSION} is published" >&2
363 + exit 1
364 + ;;
365 + esac
366 +
367 + # Exchange the workflow's OIDC token for a short-lived NuGet API key. The
368 + # key is written to the environment for the subsequent `dotnet nuget push`
369 + # via the NUGET_API_KEY variable this action sets.
370 + - name: NuGet trusted-publishing login
371 + if: steps.nuget-check.outputs.exists != 'true'
372 + uses: NuGet/login@v1
373 + id: nuget-login
374 + with:
375 + user: ${{ secrets.NUGET_USER }}
376 +
377 + - name: Publish package
378 + if: steps.nuget-check.outputs.exists != 'true'
379 + shell: bash
380 + run: |
381 + dotnet nuget push packaging/nuget/dist/*.nupkg \
382 + --api-key "${{ steps.nuget-login.outputs.NUGET_API_KEY }}" \
383 + --source https://api.nuget.org/v3/index.json \
384 + --skip-duplicate
.gitignore
+7
@@ -7,3 +7,10 @@
7
8 # Secrets
9 .env
10 +
11 +# NuGet (.NET tool)
12 +packaging/nuget/**/bin/
13 +packaging/nuget/**/obj/
14 +packaging/nuget/**/native/
15 +packaging/nuget/dist/
16 +packaging/nuget/NuGet.Config
README.md
+6 -1
@@ -10,7 +10,12 @@ drive Cloud Sessions, all from the terminal.
10 cargo install --path crates/cli
11 ```
12
13 -This installs a binary named `si`.
13 +This installs a binary named `si`. On a machine with the .NET SDK there is also
14 +a prebuilt tool:
15 +
16 +```sh
17 +dotnet tool install --global SiGit.Cli
18 +```
19
20 ## Usage
21
packaging/nuget/si/Program.cs new
+112
@@ -0,0 +1,112 @@
1 +using System.ComponentModel;
2 +using System.Diagnostics;
3 +using System.Runtime.InteropServices;
4 +
5 +internal static class Program
6 +{
7 + private const string CommandName = "si";
8 +
9 + public static async Task<int> Main(string[] arguments)
10 + {
11 + try
12 + {
13 + string executablePath = ResolveExecutablePath();
14 + EnsureExecutablePermissions(executablePath);
15 + return await RunAsync(executablePath, arguments);
16 + }
17 + catch (Exception exception) when (
18 + exception is FileNotFoundException or
19 + PlatformNotSupportedException or
20 + Win32Exception)
21 + {
22 + Console.Error.WriteLine($"{CommandName}: {exception.Message}");
23 + return 1;
24 + }
25 + }
26 +
27 + private static string ResolveExecutablePath()
28 + {
29 + string runtimeIdentifier = GetRuntimeIdentifier();
30 + string executableName = OperatingSystem.IsWindows() ? $"{CommandName}.exe" : CommandName;
31 + string executablePath = Path.GetFullPath(
32 + Path.Combine(AppContext.BaseDirectory, "native", runtimeIdentifier, executableName));
33 +
34 + if (!File.Exists(executablePath))
35 + {
36 + throw new FileNotFoundException(
37 + $"The native {CommandName} executable for '{runtimeIdentifier}' is not bundled in this package.",
38 + executablePath);
39 + }
40 +
41 + return executablePath;
42 + }
43 +
44 + private static string GetRuntimeIdentifier()
45 + {
46 + string operatingSystem = OperatingSystem.IsWindows()
47 + ? "windows"
48 + : OperatingSystem.IsMacOS()
49 + ? "darwin"
50 + : OperatingSystem.IsLinux()
51 + ? "linux"
52 + : throw new PlatformNotSupportedException(
53 + $"{CommandName} does not support this operating system through the .NET tool package.");
54 +
55 + string architecture = RuntimeInformation.ProcessArchitecture switch
56 + {
57 + Architecture.X64 => "x64",
58 + Architecture.Arm64 => "arm64",
59 + _ => throw new PlatformNotSupportedException(
60 + $"{CommandName} does not support the '{RuntimeInformation.ProcessArchitecture}' architecture through the .NET tool package."),
61 + };
62 +
63 + return $"{operatingSystem}-{architecture}";
64 + }
65 +
66 + private static void EnsureExecutablePermissions(string executablePath)
67 + {
68 + if (OperatingSystem.IsWindows())
69 + {
70 + return;
71 + }
72 +
73 + UnixFileMode currentMode = File.GetUnixFileMode(executablePath);
74 + UnixFileMode requiredMode = UnixFileMode.UserRead |
75 + UnixFileMode.UserWrite |
76 + UnixFileMode.UserExecute |
77 + UnixFileMode.GroupRead |
78 + UnixFileMode.GroupExecute |
79 + UnixFileMode.OtherRead |
80 + UnixFileMode.OtherExecute;
81 +
82 + if ((currentMode & requiredMode) == requiredMode)
83 + {
84 + return;
85 + }
86 +
87 + File.SetUnixFileMode(executablePath, currentMode | requiredMode);
88 + }
89 +
90 + private static async Task<int> RunAsync(string executablePath, IReadOnlyList<string> arguments)
91 + {
92 + // Leaving all three streams unredirected makes the child inherit this process's
93 + // handles, so `si` sees the real terminal (or pipe) for prompts, colour and the
94 + // `si mcp` stdio transport instead of something this launcher introduced.
95 + ProcessStartInfo startInfo = new(executablePath)
96 + {
97 + UseShellExecute = false,
98 + WorkingDirectory = Environment.CurrentDirectory,
99 + };
100 +
101 + foreach (string argument in arguments)
102 + {
103 + startInfo.ArgumentList.Add(argument);
104 + }
105 +
106 + using Process process = Process.Start(startInfo)
107 + ?? throw new Win32Exception($"Failed to start '{CommandName}'.");
108 +
109 + await process.WaitForExitAsync();
110 + return process.ExitCode;
111 + }
112 +}
packaging/nuget/si/README.md new
+48
@@ -0,0 +1,48 @@
1 +# si for .NET
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 +## Install
7 +
8 +```sh
9 +dotnet tool install --global SiGit.Cli
10 +```
11 +
12 +## Update
13 +
14 +```sh
15 +dotnet tool update --global SiGit.Cli
16 +```
17 +
18 +## Run
19 +
20 +```sh
21 +si auth login
22 +si repo list
23 +```
24 +
25 +## Platform support
26 +
27 +This .NET tool bundles native `si` binaries for:
28 +
29 +- macOS `arm64`, `x64`
30 +- Linux `arm64`, `x64` (glibc)
31 +- Windows `arm64`, `x64`
32 +
33 +Because all six binaries ship in one package, the install is larger than a single-platform
34 +download. `cargo install sigit-si-cli` builds only for your machine.
35 +
36 +## Other installation methods
37 +
38 +- Cargo: `cargo install sigit-si-cli`
39 +
40 +## Source
41 +
42 +- Repository: <https://github.com/getsigit/si>
43 +- Website: <https://sigit.si>
44 +- Issues: <https://github.com/getsigit/si/issues>
45 +
46 +## License
47 +
48 +[Apache 2.0](https://github.com/getsigit/si/blob/main/LICENSE)
packaging/nuget/si/SiGit.Cli.csproj new
+42
@@ -0,0 +1,42 @@
1 +<Project Sdk="Microsoft.NET.Sdk">
2 + <PropertyGroup>
3 + <OutputType>Exe</OutputType>
4 + <TargetFramework>net8.0</TargetFramework>
5 + <!--
6 + Targeting net8.0 keeps the tool installable on older SDKs, but a
7 + framework-dependent app only rolls forward across patch versions by
8 + default. Without this, `dotnet tool install` on a machine carrying just
9 + the .NET 10 runtime installs a tool that refuses to start with "You must
10 + install or update .NET to run this application". The shim does nothing
11 + version-sensitive, so rolling forward across majors is safe.
12 + -->
13 + <RollForward>Major</RollForward>
14 + <ImplicitUsings>enable</ImplicitUsings>
15 + <Nullable>enable</Nullable>
16 + <PackAsTool>true</PackAsTool>
17 + <ToolCommandName>si</ToolCommandName>
18 + <PackageId>SiGit.Cli</PackageId>
19 + <PackageVersion>0.0.0-local</PackageVersion>
20 + <Version>$(PackageVersion)</Version>
21 + <Authors>Seto Elkahfi</Authors>
22 + <Copyright>Copyright 2026 Seto Elkahfi, trading as siGit Code &amp; Deploy</Copyright>
23 + <Description>The sigit.si command line interface: manage repositories, review pull requests, triage issues and drive Cloud Sessions.</Description>
24 + <PackageReadmeFile>README.md</PackageReadmeFile>
25 + <PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
26 + <PackageProjectUrl>https://sigit.si</PackageProjectUrl>
27 + <RepositoryUrl>https://github.com/getsigit/si</RepositoryUrl>
28 + <PackageTags>cli;git;pull-requests;developer-tools;dotnet-tool;sigit</PackageTags>
29 + <PublishRepositoryUrl>true</PublishRepositoryUrl>
30 + </PropertyGroup>
31 +
32 + <ItemGroup>
33 + <None Include="README.md" Pack="true" PackagePath="" />
34 + <!--
35 + `native/` is populated by release-nuget.yml from the six per-target build
36 + jobs; it is gitignored and empty in a source checkout. Pack="false" keeps
37 + MSBuild from adding the binaries twice: they reach the package through the
38 + tool's publish output, which is what `dotnet tool install` unpacks.
39 + -->
40 + <Content Include="native/**/*" CopyToOutputDirectory="PreserveNewest" CopyToPublishDirectory="PreserveNewest" Pack="false" Visible="false" />
41 + </ItemGroup>
42 +</Project>
packaging/windows/check-static-crt.ps1 new
+35
@@ -0,0 +1,35 @@
1 +# Fails if a Windows binary depends on the Visual C++ runtime DLLs.
2 +#
3 +# si is linked with +crt-static (see .cargo/config.toml) so it runs on a
4 +# clean Windows install. If RUSTFLAGS overrides that, or a native dependency
5 +# drags in the DLL runtime, the exe still builds and passes tests on a runner
6 +# that has the redistributable installed, then fails to load on users'
7 +# machines. This check catches it before release.
8 +param(
9 + [Parameter(Mandatory = $true)]
10 + [string]$Path
11 +)
12 +
13 +$ErrorActionPreference = 'Stop'
14 +
15 +$vswhere = Join-Path ${env:ProgramFiles(x86)} 'Microsoft Visual Studio\Installer\vswhere.exe'
16 +$dumpbin = & $vswhere -latest -products * -find 'VC\Tools\MSVC\*\bin\Hostx64\x64\dumpbin.exe' |
17 + Select-Object -First 1
18 +if (-not $dumpbin) {
19 + throw 'dumpbin.exe not found; is the MSVC toolset installed?'
20 +}
21 +
22 +$output = & $dumpbin /nologo /dependents $Path
23 +if ($LASTEXITCODE -ne 0) {
24 + throw "dumpbin failed on $Path"
25 +}
26 +$output | Write-Host
27 +
28 +$runtime = $output |
29 + Where-Object { $_ -match '^\s+(vcruntime|msvcp|concrt|ucrtbase|api-ms-win-crt-)\S*\.dll\s*$' } |
30 + ForEach-Object { $_.Trim() }
31 +if ($runtime) {
32 + Write-Host "::error::$Path depends on the Visual C++ runtime: $($runtime -join ', ')"
33 + exit 1
34 +}
35 +Write-Host "$Path does not depend on the Visual C++ runtime."