release 0.10.0, built for every platform on Intel and ARM

Linux, macOS and Windows, each x86_64 and aarch64, on native runners.
The release is drafted first and published once every build is in, so
a failed build never leaves a public release missing downloads. CI
tests the three architectures it did not run on before.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Tobi Lütke
2026-09-25 16:50:57 +00:00
co-authored by Claude Opus 5.5
parent 033113da20
commit 8b662004a4
5 changed files with 128 additions and 59 deletions
+36
View File
@@ -98,3 +98,39 @@ jobs:
- name: Test
run: cargo xtask test
# The other half of each release: the same tests on the architectures
# the release builds for but the jobs above do not run on.
other-architectures:
name: Test (${{ matrix.name }})
strategy:
fail-fast: false
matrix:
include:
- { name: Linux aarch64, runner: ubuntu-24.04-arm }
- { name: macOS x86_64, runner: macos-15-intel }
- { name: Windows aarch64, runner: windows-11-arm }
runs-on: ${{ matrix.runner }}
steps:
- if: runner.os == 'Windows'
run: git config --global core.autocrlf false
- uses: actions/checkout@v5
- name: System libraries
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
pkg-config libxkbcommon-dev libxkbcommon-x11-dev libwayland-dev \
libx11-xcb-dev libxcb1-dev libfontconfig-dev libfreetype-dev \
libvulkan-dev libasound2-dev libssl-dev libzstd-dev
- uses: dtolnay/rust-toolchain@master
with:
toolchain: "1.97"
- uses: Swatinem/rust-cache@v2
- name: Test
run: cargo xtask test
+76 -44
View File
@@ -19,10 +19,8 @@ env:
jobs:
release:
name: Build and publish
# 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
name: Check the tag and draft the release
runs-on: ubuntu-24.04
outputs:
tag: ${{ steps.version.outputs.tag }}
version: ${{ steps.version.outputs.version }}
@@ -47,6 +45,34 @@ jobs:
echo "tag=$tag" >> "$GITHUB_OUTPUT"
echo "version=$version" >> "$GITHUB_OUTPUT"
# A draft, so nobody downloads from a release still missing half its
# builds; `publish` below makes it public once every build is in.
- name: Draft
env:
GH_TOKEN: ${{ github.token }}
TAG: ${{ steps.version.outputs.tag }}
run: |
if ! gh release view "$TAG" >/dev/null 2>&1; then
gh release create "$TAG" --draft --verify-tag \
--title "disktree ${TAG#v}" --generate-notes
fi
linux:
name: Build (Linux ${{ matrix.arch }})
needs: release
strategy:
matrix:
include:
# The oldest supported runners: their glibc is what the binary
# needs at least, so building there runs on the most systems.
- { runner: ubuntu-22.04, arch: x86_64 }
- { runner: ubuntu-22.04-arm, arch: aarch64 }
runs-on: ${{ matrix.runner }}
steps:
- uses: actions/checkout@v5
with:
ref: ${{ inputs.tag || github.ref }}
- name: System libraries
run: |
sudo apt-get update
@@ -69,37 +95,39 @@ jobs:
- name: Package
id: package
env:
VERSION: ${{ needs.release.outputs.version }}
ARCH: ${{ matrix.arch }}
run: |
name="disktree-${{ steps.version.outputs.version }}-x86_64-linux"
name="disktree-$VERSION-$ARCH-linux"
mkdir -p "dist/$name"
cp target/release/disktree "dist/$name/"
strip "dist/$name/disktree"
cp packaging/install.sh packaging/disktree.desktop.in \
assets/disktree.svg README.md LICENSE "dist/$name/"
echo "${{ steps.version.outputs.version }}" > "dist/$name/VERSION"
echo "$VERSION" > "dist/$name/VERSION"
tar -C dist -czf "dist/$name.tar.gz" "$name"
(cd dist && sha256sum "$name.tar.gz" > "$name.tar.gz.sha256")
echo "archive=dist/$name.tar.gz" >> "$GITHUB_OUTPUT"
- name: Publish
- name: Upload
env:
GH_TOKEN: ${{ github.token }}
TAG: ${{ steps.version.outputs.tag }}
TAG: ${{ needs.release.outputs.tag }}
ARCHIVE: ${{ steps.package.outputs.archive }}
run: |
if gh release view "$TAG" >/dev/null 2>&1; then
gh release upload "$TAG" "$ARCHIVE" "$ARCHIVE.sha256" --clobber
else
gh release create "$TAG" "$ARCHIVE" "$ARCHIVE.sha256" \
--title "disktree ${TAG#v}" --generate-notes
fi
run: gh release upload "$TAG" "$ARCHIVE" "$ARCHIVE.sha256" --clobber
release-macos:
name: Build and publish (macOS)
# After the Linux job, which creates the release: two jobs racing to
# create it would leave one failing.
macos:
name: Build (macOS ${{ matrix.arch }})
needs: release
runs-on: macos-15
strategy:
matrix:
include:
# `xtask bundle` names the zip after the machine it runs on, so
# each architecture builds on its own.
- { runner: macos-15, arch: aarch64 }
- { runner: macos-15-intel, arch: x86_64 }
runs-on: ${{ matrix.runner }}
env:
# Signing and notarizing happen only when the repository has these
# secrets; without them the app is signed ad hoc, and a downloaded
@@ -120,22 +148,6 @@ jobs:
with:
ref: ${{ inputs.tag || github.ref }}
- name: Version
id: version
# Through the environment, not spliced into the script: a tag typed
# into the dispatch form is text, never shell.
env:
TAG: ${{ inputs.tag || github.ref_name }}
run: |
tag="$TAG"
version=$(sed -n 's/^version = "\(.*\)"/\1/p' Cargo.toml | head -1)
if [ "$tag" != "v$version" ]; then
echo "tag $tag does not match Cargo.toml version $version" >&2
exit 1
fi
echo "tag=$tag" >> "$GITHUB_OUTPUT"
echo "version=$version" >> "$GITHUB_OUTPUT"
- uses: dtolnay/rust-toolchain@master
with:
toolchain: "1.97"
@@ -177,21 +189,27 @@ jobs:
fi
cargo xtask bundle "${args[@]}"
- name: Publish
- name: Upload
env:
GH_TOKEN: ${{ github.token }}
TAG: ${{ steps.version.outputs.tag }}
TAG: ${{ needs.release.outputs.tag }}
VERSION: ${{ needs.release.outputs.version }}
ARCH: ${{ matrix.arch }}
run: |
zip="target/bundle/disktree-${{ steps.version.outputs.version }}-aarch64-macos.zip"
zip="target/bundle/disktree-$VERSION-$ARCH-macos.zip"
(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.
name: Build (Windows ${{ matrix.arch }})
needs: release
runs-on: windows-2025
strategy:
matrix:
include:
- { runner: windows-2025, arch: x86_64 }
- { runner: windows-11-arm, arch: aarch64 }
runs-on: ${{ matrix.runner }}
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
@@ -219,8 +237,11 @@ jobs:
- name: Package
id: package
shell: pwsh
env:
VERSION: ${{ needs.release.outputs.version }}
ARCH: ${{ matrix.arch }}
run: |
$name = "disktree-${{ needs.release.outputs.version }}-x86_64-windows"
$name = "disktree-$env:VERSION-$env:ARCH-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"
@@ -229,10 +250,21 @@ jobs:
[IO.File]::WriteAllText("dist/$name.zip.sha256", "$hash $name.zip`n")
"archive=dist/$name.zip" >> $env:GITHUB_OUTPUT
- name: Publish
- name: Upload
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
publish:
name: Publish
needs: [release, linux, macos, windows]
runs-on: ubuntu-24.04
steps:
- name: Publish
env:
GH_TOKEN: ${{ github.token }}
TAG: ${{ needs.release.outputs.tag }}
run: gh release edit "$TAG" --repo "$GITHUB_REPOSITORY" --draft=false --latest