Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
108 commits
Select commit Hold shift + click to select a range
93e27ad
Fix the macOS and Windows CI failures on main (#1)
huntharo Oct 29, 2026
b59e73a
Rename the app to PwrDisk, a maintained fork of disktree (#2)
huntharo Oct 29, 2026
ebdb610
Sign releases through the apple-signing and windows-signing environme…
huntharo Oct 29, 2026
8f63e4d
Fix quadratic marking, path resolution, and removal review (#5)
huntharo Oct 29, 2026
3102ea6
docs(agents): attach PR images with gh --attach and adopt the Pwr fam…
huntharo Oct 30, 2026
64e5472
Show measured macOS service-store usage without access nags (#10)
huntharo Oct 30, 2026
40b87fb
Move to custom window chrome (port of tobi/disktree#107) (#13)
huntharo Oct 30, 2026
8d14a7a
ci: skip build and test jobs on docs-only PRs (#12)
huntharo Oct 30, 2026
db9d2e0
Report APFS clone sharing and estimate reclaimable space (#9)
huntharo Oct 30, 2026
e1492ce
macOS: Icon Composer bundle icon and a Dock icon for unbundled runs (…
huntharo Oct 30, 2026
f8421c1
Add the PwrAgent environment: build, test, lint and start
huntharo Oct 30, 2026
ee680cb
feat(release): ship a DMG and Velopack installers with in-app updates…
huntharo Oct 30, 2026
2dd8ae4
docs(release): add PwrDisk release skill
huntharo Oct 30, 2026
a45bb70
fix(core): credit the clone accounting to its author (#16)
huntharo Oct 30, 2026
03f0706
chore(app): add debug and release launch actions
huntharo Oct 30, 2026
2ce2193
feat(mcp): let an AI agent drive PwrDisk over MCP, with embedded skil…
huntharo Oct 30, 2026
afdd515
docs(ci): add cached Sandboxer verification (#20)
huntharo Oct 30, 2026
37a632a
feat(app): add the Pwr family's menus, Settings, Help windows and dia…
huntharo Oct 30, 2026
4817db7
feat(app): show estimated whole-drive scan progress (#18)
huntharo Oct 30, 2026
8967956
fix(mcp): preserve the window root when linking earlier marks (#19)
huntharo Oct 30, 2026
3e74fe8
feat(windows): link the PwrDisk window to its MCP agent over a named …
huntharo Oct 30, 2026
32d2a30
feat(app): bring the Logs window up to the family viewer (#22)
huntharo Oct 30, 2026
843dbe0
chore(ci): gate third-party license notices (#21)
huntharo Oct 30, 2026
92d8747
chore(release): v0.12.0
huntharo Oct 30, 2026
f82f5fc
docs(release): push preparation directly to main
huntharo Oct 30, 2026
ba9d150
fix(ci): refresh notices for the Windows link dependencies (#25)
huntharo Oct 31, 2026
b9c40e8
docs: rebuild the README around downloads (#24)
huntharo Oct 31, 2026
25f45b9
chore(release): v0.13.0
huntharo Oct 31, 2026
f17a67f
docs(release): regenerate notices for version bumps
huntharo Oct 31, 2026
7b64361
fix(core): scope MCP cleanup candidates and expose scan context (#26)
huntharo Oct 31, 2026
c774b68
feat(removal): require confirmed MCP removal and capacity limits (#27)
huntharo Oct 31, 2026
4d68f6c
chore(release): v0.14.0
huntharo Oct 31, 2026
bff4434
fix(core): preserve APFS reclaim bounds in MCP reports (#29)
huntharo Oct 31, 2026
8434597
test(scan): wait for both helper resource limits (#37)
huntharo Oct 31, 2026
e35b768
docs(app): record accessibility audit findings and gaps (#36)
huntharo Oct 31, 2026
2a003b1
fix(ssh): use POSIX paths for Unix hosts (port of tobi/disktree#115) …
huntharo Oct 31, 2026
efde315
fix(core): decode mount sources once (port of tobi/disktree#73) (#31)
huntharo Oct 31, 2026
34cbfcc
fix(core): exclude kernel roots from discovery (port of tobi/disktree…
huntharo Oct 31, 2026
53df9ff
test: sync noise file so allocation units commit on CoW filesystems (…
huntharo Oct 31, 2026
ece53ca
Keep nested empty directory search matches reachable (#34)
huntharo Oct 31, 2026
cece3b9
chore(ci): update and pin action refs (port of tobi/disktree#112) (#35)
huntharo Oct 31, 2026
6dda7bb
fix(app): let overlays close by mouse and fit the window (#44)
huntharo Oct 31, 2026
c427e2b
fix(app): expose file navigation and marked-path summaries (#38)
huntharo Nov 1, 2026
6d58aa6
fix(app): expose source fields and current scan status (#40)
huntharo Nov 1, 2026
8a1a685
fix(app): put dialog and screen buttons where macOS and Windows expec…
huntharo Nov 1, 2026
8ea7b5f
feat(app): answer update checks with a toast (#51)
huntharo Nov 1, 2026
cb3565d
feat(app): restyle Settings like the Pwr family (#52)
huntharo Nov 1, 2026
b43c82f
fix(app): centre the strip's checkboxes on its centre line (#56)
huntharo Nov 1, 2026
95f9971
fix(app): keep the review summary inside the window (#53)
huntharo Nov 1, 2026
c73bbc8
feat(app): lead Settings › About with the app icon and build line (#55)
huntharo Nov 1, 2026
a63a726
fix(app): provide focus traversal and modal containment (#42)
huntharo Nov 1, 2026
c20b18d
fix(app): split APFS clone bytes into private and shared per entry (#58)
huntharo Nov 1, 2026
7cfb099
fix(app): expose auxiliary text and keyboard reading (#43)
huntharo Nov 1, 2026
160e172
fix(app): quit at once instead of freeing the tree on the main thread…
huntharo Nov 1, 2026
72a4ff2
test(app): mark a clone-sharing worktree trio one by one (#59)
huntharo Nov 1, 2026
e1598a8
fix(app): keep tile text and state boundaries readable (#45)
huntharo Nov 1, 2026
4fefe23
chore(app): open the Logs fixture from a debug pwrdisk, not an exampl…
huntharo Nov 1, 2026
85d4ac0
docs: test GUI changes in the lab VM, never on the operator's desktop…
huntharo Nov 1, 2026
e2160d5
ci: save the Rust cache only from main, so PRs start warm (#65)
huntharo Nov 1, 2026
a05da0d
fix(app): reflow Help and readers through 200 percent zoom (#46)
huntharo Nov 1, 2026
213cdc8
fix(app): honor reduced motion during directory navigation (#47)
huntharo Nov 2, 2026
de5fbb0
fix(app): expose native text values and preserve log search space (#48)
huntharo Nov 2, 2026
305f69c
perf(core): hold the scan tree in index buffers, superseding #62 and …
huntharo Nov 2, 2026
f257294
fix(app): open the main window on screen and where it was left (#70)
huntharo Nov 2, 2026
3db2161
fix(app): open new windows on the display the user is working on (#72)
huntharo Nov 2, 2026
857cc23
perf(core): classify near the top of the tree in parallel again (#69)
huntharo Nov 2, 2026
65b294d
test(app): stop the theme watcher in the agent link tests (#74)
huntharo Nov 2, 2026
00da039
ci: share one Rust setup action across workflows (#66)
huntharo Nov 2, 2026
c6f6d17
perf(core): keep each allocation in the smallest record that holds it…
huntharo Nov 2, 2026
2ffec3c
chore(app): upgrade gpui-kit to 0.7.3 and gpui-omarchy to 0.2.1 (#75)
huntharo Nov 2, 2026
cc450a2
test(app): initialize the window harness without a theme watcher (#77)
huntharo Nov 2, 2026
da9dcca
fix(removal): allow removing what is inside /tmp and /var/tmp on macO…
huntharo Nov 2, 2026
8827b31
feat(app): switch Treemap | List from the title bar and fold the bar …
huntharo Nov 2, 2026
c1989bf
fix(app): keep the find field's hint from drawing over the legend (#79)
huntharo Nov 2, 2026
490709c
fix(app): strike marked names and underline find matches instead of w…
huntharo Nov 2, 2026
63c0f15
feat(app): add read-only MCP path-set estimates (#81)
huntharo Nov 3, 2026
7b85cfd
feat(app): filter by the legend and pin the marked total above Disk (…
huntharo Nov 3, 2026
07e4cfe
fix(app): open one level per click and keep the tree after removal (#82)
huntharo Nov 3, 2026
8d92dcf
feat(mcp): say in ls and find what was removed since the scan (#83)
huntharo Nov 3, 2026
f169a79
feat(app): show update progress, keep the ready offer and add a strip…
huntharo Nov 3, 2026
f9114de
chore(release): v0.15.0
huntharo Nov 3, 2026
2a97a31
perf(app): stop reading the disk on every frame (#86)
huntharo Nov 3, 2026
2d94883
fix(app): ask git about checkouts through a bounded request store (#87)
huntharo Nov 3, 2026
70cb633
perf(app): keep the git probe from costing more than it shows (#88)
huntharo Nov 3, 2026
51ee114
feat(app): keep the removal list on screen and check it off as it goe…
huntharo Nov 3, 2026
43299e2
refactor(app): keep one record of a removal run (#90)
huntharo Nov 3, 2026
5d6560f
chore(release): v0.16.0
huntharo Nov 3, 2026
f11da3b
fix(removal): end the run when the worker cannot start (#92)
huntharo Nov 3, 2026
69858fa
fix(app): keep the pointer on a toast from reaching the treemap (#94)
huntharo Nov 3, 2026
5692af9
fix(app): stop clipping descenders on the scan heading (#95)
huntharo Nov 3, 2026
c90154c
fix(app): keep floating menus, bars and pills from passing the pointe…
huntharo Nov 3, 2026
2a357e8
fix(removal): never offer home folders for removal, and gate marks pa…
huntharo Nov 4, 2026
696f2bb
fix(app): reconcile MCP removal outcomes and report observed space (#…
huntharo Nov 4, 2026
a2113eb
feat(app): move notices to toasts, pin sidebar headers, add Settings …
huntharo Nov 4, 2026
8496076
fix(removal): refuse other users' home folders on Linux (#98)
huntharo Nov 4, 2026
d98a948
fix(removal): hold each disk to its own confirmed share past the limi…
huntharo Nov 4, 2026
b668a30
fix(removal): hold an agent's removal worker to the agent limit (#104)
huntharo Nov 4, 2026
bd0213b
feat(core): distinguish artifact detections from cleanup suggestions …
huntharo Nov 4, 2026
2b82633
feat(app): fold the side panel's empty and secondary parts on short w…
huntharo Nov 4, 2026
02172b2
feat(app): size the legend's chips and fold empty kinds into a +N men…
huntharo Nov 4, 2026
fce13fb
chore(release): v0.17.0
huntharo Nov 4, 2026
cabbfc7
perf(core): cut the cost of APFS clone accounting (#112)
huntharo Nov 4, 2026
a45c7d1
docs: adopt property, model and oracle tests (#114)
huntharo Nov 4, 2026
77a5307
feat(app): clean tool caches through supported owners (#101)
huntharo Nov 4, 2026
20fe9ea
feat(app): decide cache cleanup per path, with deliberate Delete file…
huntharo Nov 4, 2026
9cae515
test(core): property, model and oracle tests for cache cleanup (#113)
huntharo Nov 4, 2026
173d738
fix(core): make hardlink partial estimates order independent (#115)
huntharo Nov 4, 2026
2d7c916
feat(app): switch legend kinds with an only pill, and keep tooltips o…
huntharo Nov 4, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
251 changes: 251 additions & 0 deletions .agents/skills/release/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,251 @@
---
name: release
description: Prepare and verify a PwrDisk release, push one release commit directly to main, tag the verified commit, monitor signed publication, and hand off promotion. Use for cutting PwrDisk releases or checking release status; ordinary feature and fix PRs do not use this workflow.
---

# PwrDisk release

Release `pwrdrvr/PwrDisk` using the checked-in GitHub Actions workflow.
Read the applicable `AGENTS.md`, [release runbook](../../../docs/releasing.md),
[release workflow](../../../.github/workflows/release.yml), its adjacent
[design notes](../../../.github/workflows/README.md), and
[xtask](../../../xtask/src/main.rs) before changing release metadata.
Those files are authoritative; PwrRoute and PwrAgent have different publishing
and promotion behavior.

Match the user's requested scope: preparation ends with a reviewable local
commit; a request to cut a release authorizes pushing that one release commit
directly to `main`, then pushing its tag. Do not open a release-prep PR.
Signing-environment approvals and promotion to Latest belong to the operator.
Resume an existing preparation or run at its current stage rather than
duplicating it.

## Establish the version and changes

Inspect the worktree, remotes, existing release commits and published releases.
Push only to the remote pointing at `pwrdrvr/PwrDisk`; upstream and personal
forks are read-only. Examples below assume that remote is `origin`.
Preserve unrelated work, using an isolated worktree when needed.

```bash
git fetch origin main --tags
gh release list -R pwrdrvr/PwrDisk --limit 10
git log --oneline vPREV..origin/main
```

Substitute the previous release tag for `vPREV` and the intended version for
`X.Y.Z` throughout this skill. Read merged PR descriptions and relevant diffs
since that release, including direct commits. Distinguish fork releases from
upstream tags; do not select the highest local tag blindly. If the request and
context do not establish the version, ask while continuing scope inspection.

PwrDisk continues upstream's version sequence; its first fork release is
0.12.0. Use suffix-free `vX.Y.Z` for stable releases, `-rc.N` for candidates,
and `-beta.N` or `-alpha.N` for builds off main. Every release is initially a
GitHub Pre-release; only suffix-free tags may be promoted to Latest.

## Prepare one release commit

Use a clean checkout of current `origin/main`. An isolated worktree can keep
unrelated edits safe; it does not require a preparation branch or PR. Reuse
existing unpublished preparation after inspecting its diff. Keep all release
preparation in one commit on top of main. The normal preparation is:

| File | Change |
| --- | --- |
| `Cargo.toml` | Set `[workspace.package].version` to `X.Y.Z`. |
| `Cargo.lock` | Refresh workspace versions without upgrading dependencies. |
| `CHANGELOG.md` | Move Unreleased entries under `## vX.Y.Z`. |
| `THIRD_PARTY_LICENSES` | Regenerate with `cargo xtask licenses` after the version bump. |

All workspace crates inherit the root version. Refresh the lockfile with
`cargo metadata --format-version 1`, redirecting its large JSON output to a
temporary file. Do not use `--no-deps`, which skips the lockfile refresh.
Inspect the diff: only workspace package versions should change in the
lockfile. Investigate dependency drift rather than bundling it into the bump.
Bundle and desktop-entry versions are generated from the crate version;
do not replace unrelated version strings or change `com.pwrdrvr.pwrdisk`.

`THIRD_PARTY_LICENSES` embeds all six workspace crate versions
(`disktree-app`, `disktree-core`, `disktree-link`, `disktree-mcp`,
`disktree-scan` and `xtask`), so ordinary version bumps require regeneration
even when dependencies are unchanged. Use the `cargo-about` version pinned
in [CI](../../../.github/workflows/ci.yml), currently `0.9.2`, for both
generation and verification:

```bash
cargo install --locked cargo-about@0.9.2 --features cli
cargo xtask licenses
```

Review the generated diff for the expected workspace-version changes.
Investigate any other changes; do not upgrade dependencies or alter license
policy to make an ordinary bump pass, and do not edit the notices by hand.
Include the generated file in the same release commit as the version,
lockfile and changelog.

This differs from `licenses/velopack.txt`, the notices for Velopack's native
binaries: regenerate that input only when the pinned Velopack tooling
changes, not for an ordinary PwrDisk version bump.

Preserve the changelog format, leave Unreleased empty, and reconcile its
existing bullets with the merged changes. If the target section already
exists, review and update it rather than creating a duplicate. Only release
preparation edits this file.

Write user-facing bullets from the included changes, for example
`- SSH scans - Show progress while scanning remote disks.`
Name the affected feature, describe what users gain or what is fixed, and
include measured results only when supported. Avoid PR-number lists and
internal implementation notes. This section supplies the GitHub release notes
and the notes Velopack displays beside an update.

## Verify and push main

Run the repository gates and inspect their actual results. Follow
[remote verification](../../../docs/sandboxer.md) for Linux checks when
Sandboxer is available. Commit preparation locally before transferring it;
if corrections are needed, amend the unpublished release commit and verify
its final tree.

```bash
cargo xtask release-check --tag vX.Y.Z
cargo xtask licenses --check
cargo xtask lint
cargo xtask test
```

The notices check must report `THIRD_PARTY_LICENSES is current`, using the
same CI-pinned `cargo-about` version as regeneration.
The metadata gate must report `release metadata agrees for vX.Y.Z`. Also
inspect workspace package versions in `Cargo.lock`; the gate checks the root
version, tag and nonempty changelog section. Report unavailable or failed
checks; do not claim the release is verified while the lint gate is red.

Commit the release files together as `chore(release): vX.Y.Z`. For a
preparation-only request, hand off the verified local commit here.

For a release request, fetch `origin/main` again before pushing. If main
advanced, replay the unpublished release commit onto it without a merge
commit, reconcile the added changes with the release notes, and repeat
affected checks. Confirm the final tree was verified and the only commit
being added is the release preparation:

```bash
git fetch origin main
git merge-base --is-ancestor origin/main HEAD
git rev-list --count origin/main..HEAD
```

The ancestor check must succeed and the count must be exactly `1`. Push that
commit as a normal fast-forward update with `git push origin HEAD:main`.
Do not force-push, add a merge commit, or fall back to a PR if repository
policy rejects the push; report the rejection and stop. Verify remote main
holds the exact release commit before tagging it.

Report the commit and verification results. Stop the verification sandbox
after checks; this workflow has no PR watch to clean it up automatically.

## Tag and monitor publication

Before pushing, confirm the intended commit is on `origin/main` and that both
`apple-signing` and `windows-signing` still require reviewer approval and
allow only `v*` tag deployments. Inspect configuration and secret names,
never secret values; [the runbook](../../../docs/releasing.md) lists them.
Missing configuration is a blocker, not permission to alter signing policy.

Inspect local and remote tags first. If the tag already exists, inspect its
target and run; never move or overwrite it as routine release preparation.
Create an annotated tag on the exact verified full commit SHA, preserving any
configured signing policy, and push only that tag:

```bash
git tag -a vX.Y.Z RELEASE_COMMIT_SHA -m "vX.Y.Z"
git push origin refs/tags/vX.Y.Z
git ls-remote origin 'refs/tags/vX.Y.Z*'
gh run list -R pwrdrvr/PwrDisk --workflow release.yml --limit 10
```

Verify the remote tag's peeled commit equals the intended release commit.
Find the workflow run for that tag and commit, not simply the newest run.
Monitor without blocking user updates for long periods. Give the operator
the run link and pending environment when approval is needed, and continue
monitoring after approval. Reaching a signing gate is not publication.

The current pipeline checks metadata and lints, builds Linux for `x86_64`
and `aarch64`, prepares a universal macOS app and both Windows architectures,
then signs and packs macOS and Windows in separate jobs. Only `macos-sign`
and `windows-sign` use their respective signing environments. They verify
the preparation archives' digests and never check out or build source.
Publication creates one GitHub Pre-release only after all assets are ready;
a failed build leaves no partial GitHub release.

On failure, inspect the failed job logs, report the cause, and stop publication
progression. Do not bypass approvals, downgrade signing, force-push, move an
existing tag, or dispatch replacement runs as an automatic retry. Recovery
requires explicit direction. For an authorized rebuild of an existing tag,
both the workflow ref and its tag input must name that same tag:

```bash
gh workflow run release.yml -R pwrdrvr/PwrDisk --ref vX.Y.Z -f tag=vX.Y.Z
```

An existing GitHub release causes publication to fail; rebuilding it requires
deleting that release first, which can interrupt update feeds. Report that
condition and obtain explicit authorization for deletion rather than removing
it automatically. Monitor one authorized recovery attempt and stop to diagnose
if it fails again.

## Verify the published release

```bash
gh release view vX.Y.Z -R pwrdrvr/PwrDisk \
--json url,isDraft,isPrerelease,assets,body
gh release view -R pwrdrvr/PwrDisk --json tagName,url
```

Check the intended release is a non-draft Pre-release, every required job
succeeded, its body matches the prepared changelog section, and the expected
assets are present. Use the runbook's asset table as the authoritative list:

| Platform | Required coverage |
| --- | --- |
| Linux | x86_64 and aarch64 tarballs, each with `.sha256`. |
| macOS | Universal DMG, portable zip, full package, osx feeds and checksums. |
| Windows | Setup.exe, MSI, portable zip, full package and feeds for both architectures; shared checksums. |

Optional delta packages depend on an available previous full package, so do
not require a fixed asset count. Preserve Velopack's channel feeds (`osx`,
`win`, `win-arm64`); installed copies need them for updates. Download assets
to a temporary directory and verify their checksum manifests. Check signing
logs for Developer ID signing, team ID, notarization, staples and Gatekeeper
verification of both app and DMG, and valid timestamped Windows signatures
with the configured publisher, including installers and updater binaries.

Do not manually create the release ahead of CI or replace its changelog notes
with generated notes. There is no Winget or Homebrew distribution job to run.
Keep the `velopack` crate pin, `VPK_VERSION`, package hash and
`licenses/velopack.txt` aligned if a release includes a Velopack upgrade;
an ordinary version bump leaves those unchanged but still regenerates
`THIRD_PARTY_LICENSES` as described above.

## Hand off promotion

Have the operator install from the DMG and Setup.exe and check the result
before promoting a suffix-free tag. Report installation and updater smoke
tests separately from CI signing verification; do not infer a working
installation from successful builds alone. Give the operator this command:

```bash
gh release edit vX.Y.Z -R pwrdrvr/PwrDisk --latest --prerelease=false
```

Do not execute promotion as part of a routine release request. Stable · Latest
is the default update channel and sees the release only after promotion;
before that it is available to Stable · Prerelease and Beta · Prerelease.
After the operator promotes, verify Latest points to the intended tag.
Suffixed tags remain prereleases.

Report the release URL, exact commit and tag, verification results, signing
and asset status, promotion status, and any remaining blockers. Distinguish a
published prerelease awaiting smoke checks from a promoted stable release.
3 changes: 3 additions & 0 deletions .agents/skills/release/agents/openai.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
interface:
display_name: "PwrDisk Release"
short_description: "Prepare PwrDisk releases and verify publication"
27 changes: 27 additions & 0 deletions .codex/environments/environment.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
version = 1
name = "PwrDisk"

[[actions]]
name = "Build"
icon = "build"
command = "cargo build --locked -p disktree-app"

[[actions]]
name = "Test"
icon = "test"
command = "cargo xtask test"

[[actions]]
name = "Lint"
icon = "test"
command = "cargo xtask lint"

[[actions]]
name = "Start - Debug"
icon = "run"
command = "cargo run --locked -p disktree-app"

[[actions]]
name = "Start - Release"
icon = "run"
command = "cargo run --release --locked -p disktree-app"
4 changes: 4 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# The MCP server compiles skills/ in and serves each file with its
# sha256; a CRLF checkout would change the digests and break the
# frontmatter it reads.
skills/** text eol=lf
75 changes: 75 additions & 0 deletions .github/actions/setup-rust/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: Set up Rust
description: >-
Install the Rust toolchain rust-toolchain.toml pins, remove every other
one, and restore the Rust cache, saving it only from main unless save-if
says otherwise.

# One copy of the setup every Rust job needs, so the pin, the prune and
# the cache's save rule cannot drift apart between ci.yml, preview-build.yml
# and release.yml. The reasons are in .github/workflows/README.md, under
# "The Rust cache". A local action, so the job must check out the
# repository first.
inputs:
components:
description: Extra toolchain components, comma-separated.
required: false
default: ""
targets:
description: Extra compilation targets, comma-separated.
required: false
default: ""
cache-bin:
description: Whether rust-cache also caches ~/.cargo/bin.
required: false
default: "true"
save-if:
description: >-
Whether rust-cache saves. Empty, the default, saves only on main.
required: false
default: ""

outputs:
toolchain:
description: The pinned Rust version, for keys that depend on it.
value: ${{ steps.pin.outputs.channel }}

runs:
using: composite
steps:
# The checked-out rust-toolchain.toml is the only place the version is
# written, so a release tag builds with the Rust it pinned, not with
# whatever a repository variable says today. Carriage returns are
# dropped because a Windows checkout may convert line endings.
- name: Read the pinned Rust version
id: pin
shell: bash
run: |
channel=$(tr -d '\r' < rust-toolchain.toml \
| sed -n 's/^channel *= *"\([^"]*\)".*/\1/p')
if [ -z "$channel" ]; then
echo "::error file=rust-toolchain.toml::no channel"
exit 1
fi
echo "channel=$channel" >> "$GITHUB_OUTPUT"

# The lint gate denies clippy::all and ::pedantic, and a newer clippy's
# new lints are a change to make on purpose, not by surprise. dtolnay
# installs the minimal profile, so a job that runs clippy or rustfmt
# asks for them.
- uses: dtolnay/rust-toolchain@683b588c487a69d01f6c6ddf40f036ff682cc2c8 # master
with:
toolchain: ${{ steps.pin.outputs.channel }}
components: ${{ inputs.components }}
targets: ${{ inputs.targets }}

# Before rust-cache, whose key hashes every installed toolchain.
- name: Keep only the pinned Rust toolchain
shell: bash
run: ./scripts/ci/prune-rust-toolchains.sh

- uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3
with:
# Only main saves by default, so PR saves cannot evict the entries
# every PR restores from the 10 GB store.
save-if: ${{ inputs.save-if || github.ref == 'refs/heads/main' }}
cache-bin: ${{ inputs.cache-bin }}
Loading
Loading