detached c2ef753

fix(bootstrap): improve prerelease detection and add dedicated dev installer script

commit
c2ef753dcb647aef20b4a1e97c8b389b89843c51
author
bnema · · 2025-10-26 14:16 UTC
parent
854257e
signature
unsigned
2 files · +133 -1
A install-bin-dev.sh +131 -0
@@ -0,0 +1,131 @@
1+#!/bin/bash
2+# ArchUp Installer Bootstrap Script - Dev/Pre-release Version
3+# Downloads and runs the latest ArchUp Go installer pre-release
4+#
5+# Usage:
6+# curl -fsSL https://archup.run/install/bin/dev | bash
7+#
8+# Or locally:
9+# ./install-bin-dev.sh # Install latest pre-release
10+# ./install-bin-dev.sh --version v0.4.0-dev # Install specific version
11+
12+set -e
13+
14+# Default to dev mode
15+DEV_MODE=true
16+SPECIFIC_VERSION=""
17+
18+while [[ $# -gt 0 ]]; do
19+ case $1 in
20+ --version)
21+ SPECIFIC_VERSION="$2"
22+ shift 2
23+ ;;
24+ *)
25+ echo "Unknown option: $1"
26+ echo "Usage: $0 [--version VERSION]"
27+ exit 1
28+ ;;
29+ esac
30+done
31+
32+# Colors for output
33+RED='\033[0;31m'
34+GREEN='\033[0;32m'
35+BLUE='\033[0;34m'
36+YELLOW='\033[0;33m'
37+NC='\033[0m' # No Color
38+
39+info() {
40+ echo -e "${BLUE}[INFO]${NC} $1"
41+}
42+
43+success() {
44+ echo -e "${GREEN}[OK]${NC} $1"
45+}
46+
47+warning() {
48+ echo -e "${YELLOW}[WARN]${NC} $1"
49+}
50+
51+error() {
52+ echo -e "${RED}[ERROR]${NC} $1"
53+ exit 1
54+}
55+
56+# Check if running on Arch Linux
57+info "Checking system requirements..."
58+if [ ! -f /etc/arch-release ]; then
59+ error "This installer must be run on Arch Linux ISO"
60+fi
61+success "Running on Arch Linux"
62+
63+# Check for UEFI mode
64+if [ ! -d /sys/firmware/efi ]; then
65+ error "UEFI mode required (legacy BIOS not supported)"
66+fi
67+success "UEFI mode detected"
68+
69+# Check architecture
70+ARCH=$(uname -m)
71+if [ "$ARCH" != "x86_64" ]; then
72+ error "Only x86_64 architecture is supported (detected: $ARCH)"
73+fi
74+success "Architecture: $ARCH"
75+
76+# GitHub repository details
77+REPO_OWNER="bnema"
78+REPO_NAME="archup"
79+BINARY_NAME="archup-installer"
80+
81+# Determine which version to download
82+if [ -n "$SPECIFIC_VERSION" ]; then
83+ # User specified a version
84+ LATEST_TAG="$SPECIFIC_VERSION"
85+ info "Using specific version: $LATEST_TAG"
86+else
87+ # Get latest pre-release (including dev/rc builds)
88+ warning "Dev mode: fetching latest pre-release..."
89+ RELEASES_URL="https://api.github.com/repos/$REPO_OWNER/$REPO_NAME/releases"
90+ # Filter for releases where "prerelease": true, then get the first tag_name
91+ LATEST_TAG=$(curl -s "$RELEASES_URL" | grep -B 10 '"prerelease": true' | grep '"tag_name":' | head -n 1 | sed -E 's/.*"([^"]+)".*/\1/')
92+
93+ if [ -z "$LATEST_TAG" ]; then
94+ error "Failed to fetch latest pre-release"
95+ fi
96+ warning "Latest pre-release: $LATEST_TAG"
97+fi
98+
99+# Download binary
100+BINARY_URL="https://github.com/$REPO_OWNER/$REPO_NAME/releases/download/$LATEST_TAG/$BINARY_NAME"
101+BINARY_PATH="/tmp/$BINARY_NAME"
102+CHECKSUM_URL="https://github.com/$REPO_OWNER/$REPO_NAME/releases/download/$LATEST_TAG/checksums.txt"
103+CHECKSUM_PATH="/tmp/checksums.txt"
104+
105+info "Downloading installer binary..."
106+if ! curl -fsSL "$BINARY_URL" -o "$BINARY_PATH"; then
107+ error "Failed to download installer binary from $BINARY_URL"
108+fi
109+success "Binary downloaded"
110+
111+# Download and verify checksum
112+info "Downloading checksums..."
113+if ! curl -fsSL "$CHECKSUM_URL" -o "$CHECKSUM_PATH"; then
114+ error "Failed to download checksums from $CHECKSUM_URL"
115+fi
116+success "Checksums downloaded"
117+
118+info "Verifying checksum..."
119+cd /tmp
120+if ! sha256sum -c "$CHECKSUM_PATH" --ignore-missing 2>/dev/null; then
121+ error "Checksum verification failed! Binary may be corrupted or tampered with."
122+fi
123+success "Checksum verified"
124+
125+# Make executable
126+chmod +x "$BINARY_PATH"
127+
128+# Run installer
129+info "Launching ArchUp installer..."
130+echo ""
131+exec "$BINARY_PATH"
@@ -0,0 +1,131 @@
1+#!/bin/bash
2+# ArchUp Installer Bootstrap Script - Dev/Pre-release Version
3+# Downloads and runs the latest ArchUp Go installer pre-release
4+#
5+# Usage:
6+# curl -fsSL https://archup.run/install/bin/dev | bash
7+#
8+# Or locally:
9+# ./install-bin-dev.sh # Install latest pre-release
10+# ./install-bin-dev.sh --version v0.4.0-dev # Install specific version
11+
12+set -e
13+
14+# Default to dev mode
15+DEV_MODE=true
16+SPECIFIC_VERSION=""
17+
18+while [[ $# -gt 0 ]]; do
19+ case $1 in
20+ --version)
21+ SPECIFIC_VERSION="$2"
22+ shift 2
23+ ;;
24+ *)
25+ echo "Unknown option: $1"
26+ echo "Usage: $0 [--version VERSION]"
27+ exit 1
28+ ;;
29+ esac
30+done
31+
32+# Colors for output
33+RED='\033[0;31m'
34+GREEN='\033[0;32m'
35+BLUE='\033[0;34m'
36+YELLOW='\033[0;33m'
37+NC='\033[0m' # No Color
38+
39+info() {
40+ echo -e "${BLUE}[INFO]${NC} $1"
41+}
42+
43+success() {
44+ echo -e "${GREEN}[OK]${NC} $1"
45+}
46+
47+warning() {
48+ echo -e "${YELLOW}[WARN]${NC} $1"
49+}
50+
51+error() {
52+ echo -e "${RED}[ERROR]${NC} $1"
53+ exit 1
54+}
55+
56+# Check if running on Arch Linux
57+info "Checking system requirements..."
58+if [ ! -f /etc/arch-release ]; then
59+ error "This installer must be run on Arch Linux ISO"
60+fi
61+success "Running on Arch Linux"
62+
63+# Check for UEFI mode
64+if [ ! -d /sys/firmware/efi ]; then
65+ error "UEFI mode required (legacy BIOS not supported)"
66+fi
67+success "UEFI mode detected"
68+
69+# Check architecture
70+ARCH=$(uname -m)
71+if [ "$ARCH" != "x86_64" ]; then
72+ error "Only x86_64 architecture is supported (detected: $ARCH)"
73+fi
74+success "Architecture: $ARCH"
75+
76+# GitHub repository details
77+REPO_OWNER="bnema"
78+REPO_NAME="archup"
79+BINARY_NAME="archup-installer"
80+
81+# Determine which version to download
82+if [ -n "$SPECIFIC_VERSION" ]; then
83+ # User specified a version
84+ LATEST_TAG="$SPECIFIC_VERSION"
85+ info "Using specific version: $LATEST_TAG"
86+else
87+ # Get latest pre-release (including dev/rc builds)
88+ warning "Dev mode: fetching latest pre-release..."
89+ RELEASES_URL="https://api.github.com/repos/$REPO_OWNER/$REPO_NAME/releases"
90+ # Filter for releases where "prerelease": true, then get the first tag_name
91+ LATEST_TAG=$(curl -s "$RELEASES_URL" | grep -B 10 '"prerelease": true' | grep '"tag_name":' | head -n 1 | sed -E 's/.*"([^"]+)".*/\1/')
92+
93+ if [ -z "$LATEST_TAG" ]; then
94+ error "Failed to fetch latest pre-release"
95+ fi
96+ warning "Latest pre-release: $LATEST_TAG"
97+fi
98+
99+# Download binary
100+BINARY_URL="https://github.com/$REPO_OWNER/$REPO_NAME/releases/download/$LATEST_TAG/$BINARY_NAME"
101+BINARY_PATH="/tmp/$BINARY_NAME"
102+CHECKSUM_URL="https://github.com/$REPO_OWNER/$REPO_NAME/releases/download/$LATEST_TAG/checksums.txt"
103+CHECKSUM_PATH="/tmp/checksums.txt"
104+
105+info "Downloading installer binary..."
106+if ! curl -fsSL "$BINARY_URL" -o "$BINARY_PATH"; then
107+ error "Failed to download installer binary from $BINARY_URL"
108+fi
109+success "Binary downloaded"
110+
111+# Download and verify checksum
112+info "Downloading checksums..."
113+if ! curl -fsSL "$CHECKSUM_URL" -o "$CHECKSUM_PATH"; then
114+ error "Failed to download checksums from $CHECKSUM_URL"
115+fi
116+success "Checksums downloaded"
117+
118+info "Verifying checksum..."
119+cd /tmp
120+if ! sha256sum -c "$CHECKSUM_PATH" --ignore-missing 2>/dev/null; then
121+ error "Checksum verification failed! Binary may be corrupted or tampered with."
122+fi
123+success "Checksum verified"
124+
125+# Make executable
126+chmod +x "$BINARY_PATH"
127+
128+# Run installer
129+info "Launching ArchUp installer..."
130+echo ""
131+exec "$BINARY_PATH"
M install-bin.sh +2 -1
@@ -94,7 +94,8 @@ elif [ "$DEV_MODE" = true ]; then
9494 # Get latest pre-release (including dev/rc builds)
9595 warning "Dev mode: fetching latest pre-release..."
9696 RELEASES_URL="https://api.github.com/repos/$REPO_OWNER/$REPO_NAME/releases"
97- LATEST_TAG=$(curl -s "$RELEASES_URL" | grep -m 1 '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/')
97+ # Filter for releases where "prerelease": true, then get the first tag_name
98+ LATEST_TAG=$(curl -s "$RELEASES_URL" | grep -B 10 '"prerelease": true' | grep '"tag_name":' | head -n 1 | sed -E 's/.*"([^"]+)".*/\1/')
9899
99100 if [ -z "$LATEST_TAG" ]; then
100101 error "Failed to fetch latest pre-release"
@@ -94,7 +94,8 @@ elif [ "$DEV_MODE" = true ]; then
94 # Get latest pre-release (including dev/rc builds)94 # Get latest pre-release (including dev/rc builds)
95 warning "Dev mode: fetching latest pre-release..."95 warning "Dev mode: fetching latest pre-release..."
96 RELEASES_URL="https://api.github.com/repos/$REPO_OWNER/$REPO_NAME/releases"96 RELEASES_URL="https://api.github.com/repos/$REPO_OWNER/$REPO_NAME/releases"
97- LATEST_TAG=$(curl -s "$RELEASES_URL" | grep -m 1 '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/')97+ # Filter for releases where "prerelease": true, then get the first tag_name
98+ LATEST_TAG=$(curl -s "$RELEASES_URL" | grep -B 10 '"prerelease": true' | grep '"tag_name":' | head -n 1 | sed -E 's/.*"([^"]+)".*/\1/')
98 99
99 if [ -z "$LATEST_TAG" ]; then100 if [ -z "$LATEST_TAG" ]; then
100 error "Failed to fetch latest pre-release"101 error "Failed to fetch latest pre-release"

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 1

Tags 0

    ↑↓ moveenter openesc close