|
root / scripts / make-release.sh
make-release.sh Bash 53 lines 1.2 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
42
43
44
45
46
47
48
49
50
51
52
#!/bin/bash
#
# Create a source release tarball for Coral
#
# Usage: ./scripts/make-release.sh [version]
#

set -e

SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
CORAL_DIR="$(dirname "$SCRIPT_DIR")"
cd "$CORAL_DIR"

# Get version from reef.toml or argument
if [[ -n "$1" ]]; then
    VERSION="$1"
else
    VERSION=$(grep '^version' reef.toml | head -1 | sed 's/.*"\([^"]*\)".*/\1/')
fi

if [[ -z "$VERSION" ]]; then
    echo "Error: Could not determine version"
    exit 1
fi

RELEASE_NAME="coral-${VERSION}-source"
RELEASE_DIR="releases"
TARBALL="${RELEASE_DIR}/${RELEASE_NAME}.tar.xz"

echo "Creating release: $RELEASE_NAME"

# Create releases directory
mkdir -p "$RELEASE_DIR"

# Create tarball excluding build artifacts and git
tar --exclude='build/*' \
    --exclude='.git' \
    --exclude='releases' \
    --exclude='*.o' \
    --exclude='*.a' \
    --exclude='docs/superpowers' \
    --exclude='.DS_Store' \
    --exclude='*.swp' \
    --exclude='*~' \
    --transform "s,^,${RELEASE_NAME}/," \
    -cJf "$TARBALL" \
    reef.toml README.md src/ docs/ test/

echo "Created: $TARBALL"
ls -la "$TARBALL"

# Checksums are computed and published automatically by Isurus CI (SHA-256/512/MD5).