@driftengine/package 3.61.1 → 3.61.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@driftengine/package",
3
- "version": "3.61.1",
3
+ "version": "3.61.2",
4
4
  "description": "Builds an installable application from a game built on the engine",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
@@ -25,6 +25,7 @@
25
25
  "android",
26
26
  "ios",
27
27
  "assets",
28
+ "scripts",
28
29
  "README.md",
29
30
  "LICENSE",
30
31
  "NOTICE"
@@ -34,7 +35,7 @@
34
35
  "drift-package": "bin/drift-package.mjs"
35
36
  },
36
37
  "peerDependencies": {
37
- "@driftengine/core": "3.61.1",
38
+ "@driftengine/core": "3.61.2",
38
39
  "steamworks.js": ">=0.4.0"
39
40
  },
40
41
  "dependencies": {
@@ -0,0 +1,71 @@
1
+ #!/usr/bin/env bash
2
+ #
3
+ # Build the macOS artifacts on a Mac.
4
+ #
5
+ # **This is not the only route any more.** A Mac target cross-builds from Linux, where the packager
6
+ # ad-hoc signs it with rcodesign and archives it with `zip -y`. What that route cannot produce is a
7
+ # .dmg — hdiutil is macOS only — so this script is what makes one, and what signs with a real
8
+ # Developer ID. `drift-package doctor` prints which of the two a machine is on.
9
+ #
10
+ # The signing mode is decided by `planSigning` from the environment and printed by the build. With
11
+ # no certificate this is an **ad-hoc** signature, which is the minimum that runs: Apple Silicon's
12
+ # loader refuses an unsigned binary outright. A .dmg built that way still carries the quarantine
13
+ # flag when downloaded, and the first launch is refused until `xattr -dr com.apple.quarantine`
14
+ # clears it — which is the reason to buy a Developer ID eventually, and not a reason to wait.
15
+ #
16
+ # ./build-macos.sh --project ~/work/game
17
+ # CSC_LINK=~/certs/developer-id.p12 CSC_KEY_PASSWORD=... ./build-macos.sh --project .
18
+ # APPLE_ID=... APPLE_APP_SPECIFIC_PASSWORD=... APPLE_TEAM_ID=... ./build-macos.sh --project .
19
+
20
+ set -euo pipefail
21
+
22
+ PROJECT=""
23
+ TARGET="mac-arm64"
24
+
25
+ while [ $# -gt 0 ]; do
26
+ case "$1" in
27
+ --project) PROJECT="$2"; shift 2 ;;
28
+ --target) TARGET="$2"; shift 2 ;;
29
+ -h|--help) sed -n '2,16p' "$0"; exit 0 ;;
30
+ *) echo "unknown argument: $1" >&2; exit 2 ;;
31
+ esac
32
+ done
33
+
34
+ [ -n "$PROJECT" ] || { echo "--project is required" >&2; exit 2; }
35
+ [ -f "$PROJECT/drift.package.json" ] || {
36
+ echo "no drift.package.json in $PROJECT; that file is what a build is configured from" >&2
37
+ exit 1
38
+ }
39
+
40
+ command -v node >/dev/null || { echo "node is not on PATH" >&2; exit 1; }
41
+ command -v codesign >/dev/null || {
42
+ echo "codesign is missing: install the Xcode command line tools with xcode-select --install" >&2
43
+ exit 1
44
+ }
45
+
46
+ # See the note in build-windows.ps1: an Electron-based terminal exports this, and it turns the
47
+ # artifact into one that cannot find Electron.
48
+ unset ELECTRON_RUN_AS_NODE
49
+
50
+ cd "$PROJECT"
51
+ npm ci
52
+ npx drift-package doctor
53
+ npx drift-package build --target="$TARGET"
54
+
55
+ echo
56
+ echo "Artifacts:"
57
+ find "out/$TARGET" -maxdepth 1 -type f -print
58
+
59
+ # Said again at the end, because the interesting line scrolled past twenty minutes ago.
60
+ if [ -z "${CSC_LINK:-}${CSC_NAME:-}" ]; then
61
+ cat <<'EOF'
62
+
63
+ This build is ad-hoc signed. It runs here. A copy downloaded through a browser will be refused by
64
+ Gatekeeper until the person clears the quarantine flag:
65
+
66
+ xattr -dr com.apple.quarantine "/Applications/<the app>.app"
67
+
68
+ A Developer ID certificate in CSC_LINK removes that, and notarisation credentials remove it for
69
+ everybody rather than for the people willing to run a command.
70
+ EOF
71
+ fi