mirror of
https://github.com/tobi/disktree.git
synced 2026-11-28 08:00:53 +00:00
Merge pr/14 (Windows) onto the macOS port
One set of removal guards for all three platforms: guard_key folds macOS firmlinks and case, and now Windows case and verbatim prefixes, so within/same from #14 become key comparisons. System trees are one keyed list per platform. Fixed while merging: - plan() found home through $HOME, which Windows does not set, so every home guard was off there; std::env::home_dir() instead. - Scan: #14's Listed/Facts shape with #13's never-scanned paths, dataless iCloud folders and track-only-shared-inodes; OneDrive cloud-only folders are skipped the same way on Windows. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -70,3 +70,27 @@ jobs:
|
||||
# signature before a release does.
|
||||
- name: Bundle
|
||||
run: cargo xtask bundle
|
||||
|
||||
windows:
|
||||
name: Lint and test (Windows)
|
||||
runs-on: windows-2025
|
||||
steps:
|
||||
# Check out with the repository's own line endings, as on Linux.
|
||||
- run: git config --global core.autocrlf false
|
||||
|
||||
- uses: actions/checkout@v5
|
||||
|
||||
# Pinned with the Linux job, for the same reason. GPUI needs nothing
|
||||
# beyond the Windows SDK the runner already has.
|
||||
- uses: dtolnay/rust-toolchain@master
|
||||
with:
|
||||
toolchain: "1.97"
|
||||
components: clippy, rustfmt
|
||||
|
||||
- uses: Swatinem/rust-cache@v2
|
||||
|
||||
- name: Lint
|
||||
run: cargo xtask lint
|
||||
|
||||
- name: Test
|
||||
run: cargo xtask test
|
||||
|
||||
@@ -23,6 +23,9 @@ jobs:
|
||||
# The oldest supported runner: its glibc is what the binary needs at
|
||||
# least, so building here runs on the most systems.
|
||||
runs-on: ubuntu-22.04
|
||||
outputs:
|
||||
tag: ${{ steps.version.outputs.tag }}
|
||||
version: ${{ steps.version.outputs.version }}
|
||||
steps:
|
||||
- uses: actions/checkout@v5
|
||||
with:
|
||||
@@ -175,3 +178,53 @@ jobs:
|
||||
(cd "$(dirname "$zip")" && shasum -a 256 "$(basename "$zip")" \
|
||||
> "$(basename "$zip").sha256")
|
||||
gh release upload "$TAG" "$zip" "$zip.sha256" --clobber
|
||||
|
||||
windows:
|
||||
name: Build and publish (Windows)
|
||||
# After the Linux job, which checks the tag and creates the release.
|
||||
needs: release
|
||||
runs-on: windows-2025
|
||||
env:
|
||||
# The C runtime linked in, so disktree.exe also runs where the Visual
|
||||
# C++ runtime was never installed. For the tests too, so both steps
|
||||
# share one build.
|
||||
RUSTFLAGS: -C target-feature=+crt-static
|
||||
steps:
|
||||
- run: git config --global core.autocrlf false
|
||||
|
||||
- uses: actions/checkout@v5
|
||||
with:
|
||||
ref: ${{ inputs.tag || github.ref }}
|
||||
|
||||
- uses: dtolnay/rust-toolchain@master
|
||||
with:
|
||||
toolchain: "1.97"
|
||||
|
||||
- uses: Swatinem/rust-cache@v2
|
||||
|
||||
- name: Test
|
||||
run: cargo xtask test
|
||||
|
||||
- name: Build
|
||||
run: cargo build --release --locked -p disktree-app
|
||||
|
||||
- name: Package
|
||||
id: package
|
||||
shell: pwsh
|
||||
run: |
|
||||
$name = "disktree-${{ needs.release.outputs.version }}-x86_64-windows"
|
||||
New-Item -ItemType Directory -Force "dist/$name" | Out-Null
|
||||
Copy-Item target/release/disktree.exe, README.md, LICENSE "dist/$name/"
|
||||
Compress-Archive -Path "dist/$name" -DestinationPath "dist/$name.zip"
|
||||
$hash = (Get-FileHash "dist/$name.zip" -Algorithm SHA256).Hash.ToLower()
|
||||
# The format `sha256sum -c` reads, with a Unix line ending.
|
||||
[IO.File]::WriteAllText("dist/$name.zip.sha256", "$hash $name.zip`n")
|
||||
"archive=dist/$name.zip" >> $env:GITHUB_OUTPUT
|
||||
|
||||
- name: Publish
|
||||
shell: bash
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
TAG: ${{ needs.release.outputs.tag }}
|
||||
ARCHIVE: ${{ steps.package.outputs.archive }}
|
||||
run: gh release upload "$TAG" "$ARCHIVE" "$ARCHIVE.sha256" --clobber
|
||||
|
||||
Reference in New Issue
Block a user