Compare commits
2 Commits
bd843d2219
...
v0.1.1
| Author | SHA1 | Date | |
|---|---|---|---|
| 0ee3050704 | |||
| 80b1276f9f |
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "lux"
|
name = "lux"
|
||||||
version = "0.1.0"
|
version = "0.1.1"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
description = "A functional programming language with first-class effects, schema evolution, and behavioral types"
|
description = "A functional programming language with first-class effects, schema evolution, and behavioral types"
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
|
|||||||
@@ -44,7 +44,7 @@
|
|||||||
printf "\n"
|
printf "\n"
|
||||||
printf " \033[1;35m╦ ╦ ╦╦ ╦\033[0m\n"
|
printf " \033[1;35m╦ ╦ ╦╦ ╦\033[0m\n"
|
||||||
printf " \033[1;35m║ ║ ║╔╣\033[0m\n"
|
printf " \033[1;35m║ ║ ║╔╣\033[0m\n"
|
||||||
printf " \033[1;35m╩═╝╚═╝╩ ╩\033[0m v0.1.0\n"
|
printf " \033[1;35m╩═╝╚═╝╩ ╩\033[0m v0.1.1\n"
|
||||||
printf "\n"
|
printf "\n"
|
||||||
printf " Functional language with first-class effects\n"
|
printf " Functional language with first-class effects\n"
|
||||||
printf "\n"
|
printf "\n"
|
||||||
@@ -62,7 +62,7 @@
|
|||||||
|
|
||||||
packages.default = pkgs.rustPlatform.buildRustPackage {
|
packages.default = pkgs.rustPlatform.buildRustPackage {
|
||||||
pname = "lux";
|
pname = "lux";
|
||||||
version = "0.1.0";
|
version = "0.1.1";
|
||||||
src = ./.;
|
src = ./.;
|
||||||
cargoLock.lockFile = ./Cargo.lock;
|
cargoLock.lockFile = ./Cargo.lock;
|
||||||
|
|
||||||
@@ -79,7 +79,7 @@
|
|||||||
};
|
};
|
||||||
in muslPkgs.rustPlatform.buildRustPackage {
|
in muslPkgs.rustPlatform.buildRustPackage {
|
||||||
pname = "lux";
|
pname = "lux";
|
||||||
version = "0.1.0";
|
version = "0.1.1";
|
||||||
src = ./.;
|
src = ./.;
|
||||||
cargoLock.lockFile = ./Cargo.lock;
|
cargoLock.lockFile = ./Cargo.lock;
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,11 @@ set -euo pipefail
|
|||||||
# Builds a static binary, generates changelog, and creates a Gitea release.
|
# Builds a static binary, generates changelog, and creates a Gitea release.
|
||||||
#
|
#
|
||||||
# Usage:
|
# Usage:
|
||||||
# ./scripts/release.sh [version]
|
# ./scripts/release.sh # auto-bump patch (0.2.0 → 0.2.1)
|
||||||
|
# ./scripts/release.sh patch # same as above
|
||||||
|
# ./scripts/release.sh minor # bump minor (0.2.0 → 0.3.0)
|
||||||
|
# ./scripts/release.sh major # bump major (0.2.0 → 1.0.0)
|
||||||
|
# ./scripts/release.sh v1.2.3 # explicit version
|
||||||
#
|
#
|
||||||
# Environment:
|
# Environment:
|
||||||
# GITEA_TOKEN - API token for git.qrty.ink (prompted if not set)
|
# GITEA_TOKEN - API token for git.qrty.ink (prompted if not set)
|
||||||
@@ -34,14 +38,33 @@ warn() { printf "${YELLOW}!!${NC} %s\n" "$1"; }
|
|||||||
err() { printf "${RED}error:${NC} %s\n" "$1" >&2; exit 1; }
|
err() { printf "${RED}error:${NC} %s\n" "$1" >&2; exit 1; }
|
||||||
|
|
||||||
# --- Determine version ---
|
# --- Determine version ---
|
||||||
VERSION="${1:-}"
|
CURRENT=$(grep '^version' Cargo.toml | head -1 | sed 's/.*"\(.*\)".*/\1/')
|
||||||
if [ -z "$VERSION" ]; then
|
BUMP="${1:-patch}"
|
||||||
VERSION=$(grep '^version' Cargo.toml | head -1 | sed 's/.*"\(.*\)".*/\1/')
|
|
||||||
info "Version from Cargo.toml: v$VERSION"
|
bump_version() {
|
||||||
fi
|
local ver="$1" part="$2"
|
||||||
# Ensure v prefix
|
IFS='.' read -r major minor patch <<< "$ver"
|
||||||
[[ "$VERSION" == v* ]] || VERSION="v$VERSION"
|
case "$part" in
|
||||||
TAG="$VERSION"
|
major) echo "$((major + 1)).0.0" ;;
|
||||||
|
minor) echo "$major.$((minor + 1)).0" ;;
|
||||||
|
patch) echo "$major.$minor.$((patch + 1))" ;;
|
||||||
|
*) echo "$part" ;; # treat as explicit version
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
|
case "$BUMP" in
|
||||||
|
major|minor|patch)
|
||||||
|
VERSION=$(bump_version "$CURRENT" "$BUMP")
|
||||||
|
info "Bumping $BUMP: $CURRENT → $VERSION"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
# Explicit version — strip v prefix if present
|
||||||
|
VERSION="${BUMP#v}"
|
||||||
|
info "Explicit version: $VERSION"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
TAG="v$VERSION"
|
||||||
|
|
||||||
# --- Check for clean working tree ---
|
# --- Check for clean working tree ---
|
||||||
if [ -n "$(git status --porcelain)" ]; then
|
if [ -n "$(git status --porcelain)" ]; then
|
||||||
@@ -54,7 +77,18 @@ fi
|
|||||||
|
|
||||||
# --- Check if tag already exists ---
|
# --- Check if tag already exists ---
|
||||||
if git rev-parse "$TAG" >/dev/null 2>&1; then
|
if git rev-parse "$TAG" >/dev/null 2>&1; then
|
||||||
err "Tag $TAG already exists. Bump version in Cargo.toml or choose a different version."
|
err "Tag $TAG already exists. Choose a different version."
|
||||||
|
fi
|
||||||
|
|
||||||
|
# --- Update version in source files ---
|
||||||
|
if [ "$VERSION" != "$CURRENT" ]; then
|
||||||
|
info "Updating version in Cargo.toml and flake.nix..."
|
||||||
|
sed -i "0,/^version = \"$CURRENT\"/s//version = \"$VERSION\"/" Cargo.toml
|
||||||
|
sed -i "s/version = \"$CURRENT\";/version = \"$VERSION\";/g" flake.nix
|
||||||
|
sed -i "s/v$CURRENT/v$VERSION/g" flake.nix
|
||||||
|
git add Cargo.toml flake.nix
|
||||||
|
git commit --no-gpg-sign -m "chore: bump version to $VERSION"
|
||||||
|
ok "Version updated and committed"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# --- Generate changelog ---
|
# --- Generate changelog ---
|
||||||
|
|||||||
Reference in New Issue
Block a user