SPB Git

Repository Public

release.sh 3.7 KB 80 lines shellscript

1#!/usr/bin/env bash2# =============================================================================3#                  SP BOUCHER | INFRASTRUCTURE & AUTOMATION4#             ARTIFICIAL INTELLIGENCE • FINANCE • ENGINEERING5# =============================================================================6#7# Project          : ORIX Cosmos8# File             : Scripts/release.sh9# Module           : Scripts10# Repository       : https://git.spboucher.ai/orix-cosmos11# Project Website  : https://www.orixlab.dev12# Created          : 2026-11-2413# Last Modified    : 2026-11-2414#15# Author           : Simon-Pierre Boucher16# Position         : Professor of Finance17# Institution      : Université du Québec en Outaouais (UQO)18# Organization     : SP Boucher19# Website          : https://spboucher.ai20# Git              : https://git.spboucher.ai21#22# Preferred Contact: support@spboucher.ai23# Technical Contact: dev@spboucher.ai24# Security/Admin   : admin@spboucher.ai25#26# Copyright (c) 202627# Simon-Pierre Boucher28# All rights reserved where applicable. This file is governed by the29# applicable project license, copyright notices and relevant law.30# Existing third-party rights and notices remain unaffected.31#32# License          : None specified (no license file in this repository)33#34# Do not embed credentials, private keys, access tokens,35# certificates or confidential personal information.36#37# =============================================================================38# END OF SP BOUCHER SOURCE HEADER39# =============================================================================4041# ORIX Cosmos42# File: Scripts/release.sh43# Description: Full local release: tests, Release build, signature verification, notarization + stapling of the app, ZIP and DMG from the stapled app, notarization + stapling of the DMG, checksums, Gatekeeper assessment, validation report. Publishes nothing.44#45# Author: Simon-Pierre Boucher46# Contact: contact@spboucher.ai47#   Scripts/release.sh            full flow48#   SKIP_TESTS=1 Scripts/release.sh   reuse a test run already recorded (the report says tests were skipped)49set -euo pipefail50cd "$(dirname "$0")/.."51source Scripts/release-config.sh52require_profile53if [[ "${SKIP_TESTS:-0}" != "1" ]]; then Scripts/build.sh test; fi54Scripts/build.sh release55Scripts/sign.sh56Scripts/notarize.sh "$APP" app57Scripts/package.sh zip            # archive recreated from the stapled app58Scripts/package.sh dmg59VERSION="$(app_version)"; BUILD="$(app_build)"60DMG="dist/$ARTIFACT_PREFIX-$VERSION.dmg"61Scripts/notarize.sh "$DMG" dmg62Scripts/package.sh checksums63REPORT="dist/VALIDATION-$VERSION.txt"64{65  echo "ORIX Cosmos $VERSION ($BUILD)"66  echo "Commit: $(git rev-parse HEAD 2>/dev/null || echo unknown)$(git diff --quiet 2>/dev/null || echo ' (working tree modified)')"67  echo "Date (UTC): $(date -u +%Y-%m-%dT%H:%M:%SZ)"68  echo "Architectures: $(lipo -archs "$APP/Contents/MacOS/$APP_NAME")"69  echo "Tests in this run: $([[ "${SKIP_TESTS:-0}" == "1" ]] && echo skipped || echo executed)"70  echo; echo "== codesign =="; codesign -dvv "$APP" 2>&1 | grep -E "^(Identifier|Authority|TeamIdentifier|Timestamp|Runtime Version|CodeDirectory)" 71  echo; echo "== notarization =="72  for l in app dmg; do /usr/bin/python3 -c 'import json,sys; d=json.load(open(sys.argv[1])); print(sys.argv[2], d.get("id"), d.get("status"))' "build/notary/$l.json" "$l"; done73  echo; echo "== stapler =="; xcrun stapler validate "$APP" 2>&1 | tail -1; xcrun stapler validate "$DMG" 2>&1 | tail -174  echo; echo "== Gatekeeper =="75  spctl --assess --type execute --verbose=4 "$APP" 2>&176  spctl --assess --type open --context context:primary-signature --verbose=4 "$DMG" 2>&177  echo; echo "== SHA-256 =="; cat dist/SHA256SUMS.txt78} | tee "$REPORT"79echo "Report: $REPORT"80
Files main
Menu

Theme