assemble-release.sh
bash
sha256:bd1eb24434d281fe65142038c1bf217493421f5a86880c22dff7e6037d2d4700
feat(companion): add production macOS distribution path
Human
minor
⚠ breaking
25 days ago
| 1 | #!/bin/bash |
| 2 | set -euo pipefail |
| 3 | |
| 4 | app="" |
| 5 | package_file="" |
| 6 | output="" |
| 7 | while [[ $# -gt 0 ]]; do |
| 8 | case "$1" in |
| 9 | --app) app="$2"; shift 2 ;; |
| 10 | --package) package_file="$2"; shift 2 ;; |
| 11 | --output) output="$2"; shift 2 ;; |
| 12 | *) echo "unknown argument: $1" >&2; exit 2 ;; |
| 13 | esac |
| 14 | done |
| 15 | |
| 16 | [[ -d "$app" && -f "$package_file" && -n "$output" ]] || { |
| 17 | echo "--app, --package, and --output are required" >&2; exit 2; |
| 18 | } |
| 19 | repo_root="$(cd "$(dirname "$0")/../../.." && pwd)" |
| 20 | release="$(node -p "require('$repo_root/release/macos/release.json').version")" |
| 21 | build="$(node -p "require('$repo_root/release/macos/release.json').build")" |
| 22 | architecture="$(node -p "require('$repo_root/release/macos/release.json').architectures[0]")" |
| 23 | base="Knowtation-$release-$build-macos-$architecture" |
| 24 | |
| 25 | rm -rf "$output" |
| 26 | mkdir -p "$output" |
| 27 | ditto -c -k --sequesterRsrc --keepParent "$app" "$output/$base.zip" |
| 28 | cp "$package_file" "$output/$base.pkg" |
| 29 | cp "$app/Contents/Resources/sbom.spdx.json" "$output/sbom.spdx.json" |
| 30 | cp "$repo_root/LICENSE" "$output/LICENSE" |
| 31 | cp "$app/Contents/Resources/THIRD-PARTY-NOTICES.txt" "$output/THIRD-PARTY-NOTICES.txt" |
| 32 | |
| 33 | node "$repo_root/scripts/release/macos/generate-manifest.mjs" \ |
| 34 | --stage final \ |
| 35 | --dist "$output" \ |
| 36 | --output "$output/release-manifest.json" |
| 37 | echo "$output" |
File History
1 commit
sha256:bd1eb24434d281fe65142038c1bf217493421f5a86880c22dff7e6037d2d4700
feat(companion): add production macOS distribution path
Human
minor
⚠
25 days ago