Files
soundcraft/packaging/env.sh
T
Brandon ThomasandClaude Opus 5.5 04d222069d Release pipeline: signed macOS/Windows, Linux packages, FreeBSD, Web; app icon
- .github/workflows/release.yml: every push to `release` builds a draft
  GitHub Release: macOS universal DMG (Developer ID + notarization),
  Windows x64/x86/arm64 MSI + zips (Azure Trusted Signing), Linux
  x86_64/aarch64 AppImage/deb/rpm/tar.gz + Flatpak manifest, FreeBSD,
  Web/WASM zip; SHA256SUMS; secrets only via the release environment
- packaging/ for every platform; .scraft + audio file associations
- cargo xtask version [set X.Y.Z] and xtask ico
- apps/soundcraft-web (trunk, WebGPU/WebGL2, WebAudio)
- placeholder app icon (original nightingale), window icon, Windows resources
- ROADMAP.md

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-05 23:17:59 -04:00

60 lines
2.2 KiB
Bash

# shellcheck shell=bash
# Shared setup for the packaging scripts. Source it: `. "$(dirname "$0")/../env.sh"`.
#
# Exports:
# ROOT workspace root
# VERSION [workspace.package] version from Cargo.toml (override: SOUNDCRAFT_VERSION)
# DIST output directory for release artifacts (default: $ROOT/dist/release)
# SOUNDCRAFT_BUILD_SHA git commit (recorded in the macOS Info.plist and the job summary)
# SOUNDCRAFT_BUILD_DATE UTC build date, YYYY-MM-DD (AppStream release date)
# CARGO_TARGET_DIR cargo's target dir (default: $ROOT/target)
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
export ROOT
# The version lives in exactly one place: `[workspace.package] version` in the root Cargo.toml.
# (`cargo xtask version` prints the same thing; awk avoids compiling xtask here.)
workspace_version() {
awk '
/^\[/ { in_pkg = ($0 == "[workspace.package]") ; next }
in_pkg && $1 == "version" { gsub(/[" ]/, "", $3); print $3; exit }
' "$ROOT/Cargo.toml"
}
VERSION="${SOUNDCRAFT_VERSION:-$(workspace_version)}"
if [ -z "$VERSION" ]; then
echo "error: could not read [workspace.package] version from $ROOT/Cargo.toml" >&2
exit 1
fi
export VERSION
DIST="${DIST:-$ROOT/dist/release}"
mkdir -p "$DIST"
export DIST
if [ -z "${SOUNDCRAFT_BUILD_SHA:-}" ]; then
SOUNDCRAFT_BUILD_SHA="$(git -C "$ROOT" rev-parse HEAD 2>/dev/null || true)"
fi
export SOUNDCRAFT_BUILD_SHA
export SOUNDCRAFT_BUILD_DATE="${SOUNDCRAFT_BUILD_DATE:-$(date -u +%Y-%m-%d)}"
export CARGO_TARGET_DIR="${CARGO_TARGET_DIR:-$ROOT/target}"
# Emit a GitHub Actions warning (plain stderr outside Actions).
warn() {
if [ -n "${GITHUB_ACTIONS:-}" ]; then echo "::warning::$*"; else echo "warning: $*" >&2; fi
}
# Copy licence and readme files that exist into a package directory.
copy_docs() {
local dest="$1" f
for f in README.md LICENSE LICENSE-MIT LICENSE-APACHE NOTICE ATTRIBUTION.md COPYRIGHT; do
if [ -f "$ROOT/$f" ]; then cp "$ROOT/$f" "$dest/"; fi
done
}
# Portable SHA-256 of a file (prints just the hash).
sha256() {
if command -v sha256sum >/dev/null; then sha256sum "$1" | cut -d' ' -f1; else shasum -a 256 "$1" | cut -d' ' -f1; fi
}