Repository navigation
Expand file tree
/
Copy pathPUBLISH-UPDATE.command
More file actions
executable file
·41 lines (39 loc) · 1.79 KB
/
Copy pathPUBLISH-UPDATE.command
File metadata and controls
executable file
·41 lines (39 loc) · 1.79 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/bin/bash
# Publishes the version you just built, so every computer with PrintBridge
# 4.1.3 or newer installs it by itself (automatic updates).
#
# The order, every time:
# 1. Raise the version number: cd "Source code/release" then
# node publish-update.js bump 4.2.13
# 2. Build: ./BUILD-ALL.command
# 3. Try the new installers on one computer.
# 4. Publish: ./PUBLISH-UPDATE.command
#
# It signs latest.json with your private key (kept in
# ~/Documents/PrintBridge update key (keep secret)/ - never in this folder),
# saves everything in the "Updates" folder next to this file, and uploads
# the new release to GitHub (both printbridge-updates and printbridge) using
# your Mac's git keychain credentials or the "gh" tool.
#
# Run it from Terminal: cd to this folder, then ./PUBLISH-UPDATE.command
set -e
ROOT="$(cd "$(dirname "$0")" && pwd)"
cd "$ROOT/Source code/release"
KEY="$HOME/Documents/PrintBridge update key (keep secret)/printbridge-update-key.pem"
if [ ! -f "$KEY" ]; then
echo "There is no signing key yet, so making one now."
node publish-update.js keygen
echo
echo "Now build (./BUILD-ALL.command) so the installers know this key, install those"
echo "on every computer once, and from then on run this after each build to publish it."
exit 0
fi
VERSION="$(sed -n 's/.*VERSION: "\([^"]*\)".*/\1/p' "$ROOT/Source code/desktop/lib/version.js")"
if [ -z "$VERSION" ]; then
echo "Couldn't read the version number from Source code/desktop/lib/version.js." >&2
exit 1
fi
echo "Publishing PrintBridge $VERSION."
# With nothing to type into (not run from Terminal), go on without notes.
read -r -p "What's new in it (one line; press Enter to skip): " NOTES || NOTES=""
node publish-update.js all --notes "$NOTES"