Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 6 additions & 0 deletions .github/actionlint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,9 @@ self-hosted-runner:
- blacksmith-16vcpu-ubuntu-2404
- blacksmith-32vcpu-ubuntu-2404
- blacksmith-8vcpu-windows-2025
# Release builds (workflows/release.yml).
- blacksmith-16vcpu-ubuntu-2204
- blacksmith-16vcpu-ubuntu-2204-arm
- blacksmith-4vcpu-ubuntu-2404-arm
- blacksmith-6vcpu-macos-15
- blacksmith-12vcpu-macos-15
163 changes: 92 additions & 71 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
# The macOS app is signed and notarized when the APPLE_* secrets exist. The Windows binaries and
# MSI are Authenticode-signed through SignPath Foundation when the SIGNPATH_API_TOKEN secret exists
# (see the windows job). Nothing else is signed yet.
# Runners: Blacksmith (blacksmith-<N>vcpu-<os>), as CI uses. While SignPath signs (the
# WINDOWS_SIGNING repository variable is not `off`), the `version` and `windows` jobs run on
# GitHub-hosted runners instead: SignPath Foundation only signs a request when every job leading
# up to it ran on a GitHub-hosted runner.
#
# Linux x86_64, aarch64 AppImage (+ .zsync), .deb, .rpm, .flatpak, .snap, .tar.gz packaging/linux
# Arch Linux x86_64, aarch64 .pkg.tar.zst, repackaged from the .tar.gz the arch job
Expand Down Expand Up @@ -76,7 +80,8 @@ env:

jobs:
version:
runs-on: ubuntu-latest
# GitHub-hosted while SignPath signs: see the top of this file.
runs-on: ${{ vars.WINDOWS_SIGNING == 'off' && 'blacksmith-2vcpu-ubuntu-2404' || 'ubuntu-latest' }}
outputs:
build: ${{ steps.changed.outputs.build }}
version: ${{ steps.v.outputs.version }}
Expand Down Expand Up @@ -114,40 +119,18 @@ jobs:
{ echo "version=$VERSION"; echo "date=$(date -u +%Y-%m-%d)"; echo "prerelease=$pre"; } >>"$GITHUB_OUTPUT"
echo "### SolidCraft v$VERSION (\`${GITHUB_SHA::9}\`)" >>"$GITHUB_STEP_SUMMARY"

# The app icon in every size, drawn by solidcraft-cli (no image files are committed), for the
# Windows jobs: the ARM64 build is cross-compiled and can't run there to draw its own.
icons:
needs: version
if: needs.version.outputs.build == 'true'
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: dtolnay/rust-toolchain@1.99.1
- uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2.9.2
with:
key: release-icons
- run: cargo build --release --locked -p solidcraft-cli
- run: |
. packaging/env.sh
make_icons target/release/solidcraft-cli icons
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: icons
path: icons
if-no-files-found: error

linux:
name: Linux ${{ matrix.arch }}
needs: version
if: needs.version.outputs.build == 'true'
# The oldest GitHub-hosted image, so the binaries only need glibc >= 2.35.
# Ubuntu 22.04, the oldest image, so the binaries only need glibc >= 2.35.
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false
matrix:
include:
- { arch: x86_64, runner: ubuntu-22.04, deb: amd64 }
- { arch: aarch64, runner: ubuntu-22.04-arm, deb: arm64 }
- { arch: x86_64, runner: blacksmith-16vcpu-ubuntu-2204, deb: amd64 }
- { arch: aarch64, runner: blacksmith-16vcpu-ubuntu-2204-arm, deb: arm64 }
env:
SOLIDCRAFT_VERSION: ${{ needs.version.outputs.version }}
SOLIDCRAFT_BUILD_DATE: ${{ needs.version.outputs.date }}
Expand Down Expand Up @@ -203,8 +186,8 @@ jobs:
fail-fast: false
matrix:
include:
- { arch: x86_64, runner: ubuntu-24.04 }
- { arch: aarch64, runner: ubuntu-24.04-arm }
- { arch: x86_64, runner: blacksmith-4vcpu-ubuntu-2404 }
- { arch: aarch64, runner: blacksmith-4vcpu-ubuntu-2404-arm }
env:
SOLIDCRAFT_VERSION: ${{ needs.version.outputs.version }}
SOLIDCRAFT_BUILD_DATE: ${{ needs.version.outputs.date }}
Expand All @@ -218,8 +201,11 @@ jobs:
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends flatpak flatpak-builder librsvg2-common xvfb xauth weston dbus-x11
# Ubuntu 24.04's AppArmor blocks the unprivileged user namespaces bubblewrap needs.
sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0
# Ubuntu 24.04's AppArmor blocks the unprivileged user namespaces bubblewrap needs. Only
# where that switch exists: Blacksmith's VMs run a kernel without it (and don't block them).
if [ -e /proc/sys/kernel/apparmor_restrict_unprivileged_userns ]; then
sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0
fi
- name: Build the Flatpak bundle
run: packaging/linux/flatpak-bundle.sh "dist/linux/solidcraft-$SOLIDCRAFT_VERSION-linux-${{ matrix.arch }}.tar.gz"
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
Expand All @@ -233,7 +219,7 @@ jobs:
needs: [version, linux]
if: needs.version.outputs.build == 'true'
# makepkg only repackages the tarball's prebuilt binaries, so both architectures build here.
runs-on: ubuntu-24.04
runs-on: blacksmith-2vcpu-ubuntu-2404
# A pre-release or nightly without an Arch package is still worth having; a stable release isn't.
continue-on-error: ${{ contains(needs.version.outputs.version, '-') }}
strategy:
Expand Down Expand Up @@ -303,8 +289,8 @@ jobs:
fail-fast: false
matrix:
include:
- { arch: x86_64, runner: ubuntu-24.04 }
- { arch: aarch64, runner: ubuntu-24.04-arm }
- { arch: x86_64, runner: blacksmith-4vcpu-ubuntu-2404 }
- { arch: aarch64, runner: blacksmith-4vcpu-ubuntu-2404-arm }
env:
SOLIDCRAFT_VERSION: ${{ needs.version.outputs.version }}
SOLIDCRAFT_BUILD_DATE: ${{ needs.version.outputs.date }}
Expand All @@ -316,7 +302,12 @@ jobs:
path: dist/linux
- name: Install snapcraft and the smoke-test tools
run: |
sudo snap install snapcraft --classic
# The Snap Store sometimes times out (HTTP 408); try a few times before giving up.
for attempt in 1 2 3 4 5; do
sudo snap install snapcraft --classic && break
if [ "$attempt" = 5 ]; then exit 1; fi
sleep $((attempt * 15))
done
sudo apt-get update
sudo apt-get install -y --no-install-recommends xvfb xauth weston dbus-x11
- name: Build the snap
Expand Down Expand Up @@ -349,37 +340,70 @@ jobs:
name: FreeBSD x86_64
needs: version
if: needs.version.outputs.build == 'true'
# GitHub has no FreeBSD runners: build in a FreeBSD 14.3 VM.
runs-on: ubuntu-latest
# There are no FreeBSD runners: build in a FreeBSD 14.3 VM (Blacksmith's x64 runners have KVM).
runs-on: blacksmith-16vcpu-ubuntu-2404
timeout-minutes: 180
env:
SOLIDCRAFT_VERSION: ${{ needs.version.outputs.version }}
SOLIDCRAFT_BUILD_DATE: ${{ needs.version.outputs.date }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Build and package in a FreeBSD VM (tar.gz)
with:
# The checkout is copied into the VM; no token goes with it.
persist-credentials: false
- id: size
name: Size the VM to the runner
# All but 2 CPUs and 4 GB for the VM; about 3 GB of VM memory per build job (4 jobs in
# 12 GB was the most that fit).
run: |
cpus=$(nproc)
mem_mb=$(awk '/MemTotal/ { print int($2 / 1024) }' /proc/meminfo)
vm_cpus=$(( cpus > 4 ? cpus - 2 : 2 ))
vm_mem=$(( mem_mb > 16384 ? mem_mb - 4096 : 12288 ))
jobs=$(( vm_mem / 3072 ))
if [ "$jobs" -gt "$vm_cpus" ]; then jobs=$vm_cpus; fi
if [ "$jobs" -lt 1 ]; then jobs=1; fi
echo "runner: $cpus CPUs, $mem_mb MB; VM: $vm_cpus CPUs, $vm_mem MB, $jobs build jobs"
{ echo "cpu=$vm_cpus"; echo "mem=$vm_mem"; echo "jobs=$jobs"; } >>"$GITHUB_OUTPUT"
- name: Start a FreeBSD VM
# vmactions/freebsd-vm v1.5.9, pinned by commit (it runs our build).
# sync: no, and the source goes in and dist/ comes out with rsync below. The action's own
# sync copies $HOME/work and cds into $GITHUB_WORKSPACE, which only works where the
# checkout lives under $HOME/work (GitHub's runners). Blacksmith's is under $HOME/_work.
uses: vmactions/freebsd-vm@c46abacb49f09938ca4e1702d15d836285d694cc
with:
release: "14.3"
usesh: true
cpu: 4
mem: 12288
# Passed into the VM by name; never templated into the script below.
envs: "SOLIDCRAFT_VERSION SOLIDCRAFT_BUILD_DATE"
sync: "no"
cpu: ${{ steps.size.outputs.cpu }}
mem: ${{ steps.size.outputs.mem }}
# Passed into the VM by name (ssh SendEnv); never templated into the scripts below.
envs: "SOLIDCRAFT_VERSION SOLIDCRAFT_BUILD_DATE CARGO_BUILD_JOBS"
prepare: |
pkg install -y bash git curl pkgconf libxkbcommon wayland libX11 libXcursor libXrandr libXi libxcb mesa-libs vulkan-loader
pkg install -y bash git curl rsync pkgconf libxkbcommon wayland libX11 libXcursor libXrandr libXi libxcb mesa-libs vulkan-loader
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal --default-toolchain 1.99.1
run: |
set -e
. "$HOME/.cargo/env"
git config --global --add safe.directory "$PWD"
# Build outside the checkout so only dist/ is copied back out of the VM. 4 jobs: more
# runs the VM out of memory.
export CARGO_TARGET_DIR=/var/tmp/solidcraft-target CARGO_BUILD_JOBS=4
bash packaging/freebsd/package.sh
tar -tzf dist/release/solidcraft-*-freebsd-x86_64.tar.gz \
| grep -E '/bin/solidcraft$|/bin/solidcraft-cli$|/share/applications/io\.tangencylabs\.solidcraft\.desktop$|/share/doc/solidcraft/THIRD-PARTY-LICENSES\.txt$'
- name: Copy the source into the VM
run: rsync -a --delete --rsync-path=/usr/local/bin/rsync ./ freebsd:solidcraft/
- name: Build and package in the VM (tar.gz)
env:
CARGO_BUILD_JOBS: ${{ steps.size.outputs.jobs }}
run: |
ssh freebsd sh <<'VM'
set -eu
cd "$HOME/solidcraft"
. "$HOME/.cargo/env"
git config --global --add safe.directory "$PWD"
# Build outside the checkout so only dist/ comes back out of the VM.
export CARGO_TARGET_DIR=/var/tmp/solidcraft-target
bash packaging/freebsd/package.sh
tar -tzf dist/release/solidcraft-*-freebsd-x86_64.tar.gz \
| grep -E '/bin/solidcraft$|/bin/solidcraft-cli$|/share/applications/io\.tangencylabs\.solidcraft\.desktop$|/share/doc/solidcraft/THIRD-PARTY-LICENSES\.txt$'
VM
- name: Copy the package out of the VM
run: |
mkdir -p dist/release
rsync -a --rsync-path=/usr/local/bin/rsync freebsd:solidcraft/dist/release/ dist/release/
ls -l dist/release
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: release-freebsd-x86_64
Expand All @@ -388,11 +412,12 @@ jobs:

# The two halves of the universal binary build in parallel on their own runners (each alone
# took about half of the old single job's 45 minutes); `macos` below joins and packages them.
# Blacksmith's macOS runners are Apple silicon: the x86_64 half is cross-compiled.
macos-build:
name: macOS build ${{ matrix.arch }}
needs: version
if: needs.version.outputs.build == 'true'
runs-on: macos-15
runs-on: blacksmith-12vcpu-macos-15
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -426,7 +451,7 @@ jobs:
name: macOS universal
needs: [version, macos-build]
if: needs.version.outputs.build == 'true'
runs-on: macos-15
runs-on: blacksmith-6vcpu-macos-15
env:
SOLIDCRAFT_VERSION: ${{ needs.version.outputs.version }}
SOLIDCRAFT_BUILD_DATE: ${{ needs.version.outputs.date }}
Expand Down Expand Up @@ -466,11 +491,13 @@ jobs:

windows:
name: Windows ${{ matrix.arch }}
needs: [version, icons]
needs: version
if: needs.version.outputs.build == 'true'
# Must stay a GitHub-hosted runner, like every job before it: SignPath's open-source policy
# only signs builds whose jobs all ran on GitHub-hosted runners.
runs-on: windows-latest
# GitHub-hosted while SignPath signs, like the `version` job before it: SignPath's open-source
# policy only signs requests whose jobs leading up to them all ran on GitHub-hosted runners.
# With WINDOWS_SIGNING off nothing here goes to SignPath, so it builds on Blacksmith.
# The installer icon is the committed assets/icons/app/windows/exports/solidcraft.ico.
runs-on: ${{ vars.WINDOWS_SIGNING == 'off' && 'blacksmith-8vcpu-windows-2025' || 'windows-latest' }}
# actions: read lets the SignPath action read this job's details and fetch the uploaded
# artifact with GITHUB_TOKEN (the workflow default above grants contents: read only).
permissions:
Expand Down Expand Up @@ -501,10 +528,6 @@ jobs:
SIGNPATH_PROJECT_SLUG: solidcraft
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
with:
name: icons
path: icons
- uses: dtolnay/rust-toolchain@1.99.1
with:
targets: ${{ matrix.target }}
Expand All @@ -519,8 +542,6 @@ jobs:
- name: Build and package (msi, portable zip)
if: env.SIGN_WINDOWS != 'true'
shell: pwsh
env:
SOLIDCRAFT_ICONS: ${{ github.workspace }}/icons
run: ./packaging/windows/package.ps1 -Arch ${{ matrix.arch }}

# ---- signed path ---------------------------------------------------------------------------
Expand All @@ -534,8 +555,6 @@ jobs:
- name: Build and stage the binaries for signing
if: env.SIGN_WINDOWS == 'true'
shell: pwsh
env:
SOLIDCRAFT_ICONS: ${{ github.workspace }}/icons
run: ./packaging/windows/package.ps1 -Arch ${{ matrix.arch }} -Phase stage
- name: Upload the unsigned binaries
id: unsigned-exes
Expand Down Expand Up @@ -579,8 +598,6 @@ jobs:
- name: Package the signed binaries (msi, portable zip)
if: env.SIGN_WINDOWS == 'true'
shell: pwsh
env:
SOLIDCRAFT_ICONS: ${{ github.workspace }}/icons
run: ./packaging/windows/package.ps1 -Arch ${{ matrix.arch }} -Phase package
- name: Upload the unsigned MSI
id: unsigned-msi
Expand Down Expand Up @@ -630,7 +647,7 @@ jobs:
name: Web (wasm)
needs: version
if: needs.version.outputs.build == 'true'
runs-on: ubuntu-latest
runs-on: blacksmith-8vcpu-ubuntu-2404
env:
SOLIDCRAFT_VERSION: ${{ needs.version.outputs.version }}
TRUNK_VERSION: 0.21.14
Expand Down Expand Up @@ -659,7 +676,7 @@ jobs:
needs: [version, linux, flatpak, arch, snap, freebsd, macos, windows, web]
# Not for the release gate (packages_only): it builds and checks the packages, nothing more.
if: needs.version.outputs.build == 'true' && !inputs.packages_only
runs-on: ubuntu-latest
runs-on: blacksmith-2vcpu-ubuntu-2404
permissions:
contents: write
env:
Expand Down Expand Up @@ -804,7 +821,11 @@ jobs:
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_STORE_CREDENTIALS }}
working-directory: artifacts
run: |
sudo snap install snapcraft --classic
for attempt in 1 2 3 4 5; do
sudo snap install snapcraft --classic && break
if [ "$attempt" = 5 ]; then exit 1; fi
sleep $((attempt * 15))
done
channel=candidate
if [ "$GITHUB_EVENT_NAME" = schedule ]; then channel=edge; fi
for arch in x86_64 aarch64; do
Expand Down
6 changes: 4 additions & 2 deletions docs/releasing.md
Original file line number Diff line number Diff line change
Expand Up @@ -347,8 +347,10 @@ that every file came back signed. Without the secret (forks) the jobs build unsi
- **Test-sign without publishing:** `gh workflow run release.yml -R tangency-labs/solidcraft --ref
<branch> -f draft=false`, then check the Windows jobs' summaries and the `release-assets`
artifact.
- SignPath only signs runs whose jobs all ran on GitHub-hosted runners, so keep the `version`,
`icons` and `windows` jobs off self-hosted runners.
- SignPath only signs requests whose jobs leading up to them all ran on GitHub-hosted runners, so
while it signs, the `version` and `windows` jobs run on GitHub's runners. With the
`WINDOWS_SIGNING` repository variable set to `off` they run on Blacksmith, like every other
release job.

## Homebrew tap

Expand Down
Loading