From c3b8e8ba081f68f16f1d2bf728ac932e789bdec8 Mon Sep 17 00:00:00 2001 From: Michael Freno Date: Thu, 13 Nov 2025 17:19:17 -0500 Subject: [PATCH] ok --- .gitignore | 1 - FlexLove.lua | 2 +- release | 75 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 76 insertions(+), 2 deletions(-) create mode 100755 release diff --git a/.gitignore b/.gitignore index dee0cce..64d28fa 100644 --- a/.gitignore +++ b/.gitignore @@ -7,4 +7,3 @@ themes/space/ .DS_STORE tasks testoutput -release diff --git a/FlexLove.lua b/FlexLove.lua index d32ada0..45cca25 100644 --- a/FlexLove.lua +++ b/FlexLove.lua @@ -25,7 +25,7 @@ local enums = utils.enums local flexlove = GuiState -- Add version and metadata -flexlove._VERSION = "FlexLove v0.1.0" +flexlove._VERSION = "0.1.0" flexlove._DESCRIPTION = "UI Library for LÖVE Framework based on flexbox" flexlove._URL = "https://github.com/mikefreno/FlexLove" flexlove._LICENSE = [[ diff --git a/release b/release new file mode 100755 index 0000000..d5e45cf --- /dev/null +++ b/release @@ -0,0 +1,75 @@ +#!/bin/bash + +# Release script for FlexLove +# Usage: ./release +# Example: ./release 0.2.0 + +set -e + +if [ -z "$1" ]; then + echo "Error: Version number required" + echo "Usage: ./release " + echo "Example: ./release 0.2.0" + exit 1 +fi + +VERSION="$1" + +# Validate version format (basic semver check) +if ! [[ "$VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then + echo "Error: Invalid version format. Use semantic versioning (e.g., 0.2.0)" + exit 1 +fi + +echo "Preparing release v$VERSION..." + +# Update version in README.md +echo "Updating README.md..." +sed -i.bak "s/^# FlexLöve v[0-9]\+\.[0-9]\+\.[0-9]\+/# FlexLöve v$VERSION/" README.md +rm README.md.bak + +# Update version in FlexLove.lua +echo "Updating FlexLove.lua..." +sed -i.bak "s/FlexLove\._VERSION = \"[0-9]\+\.[0-9]\+\.[0-9]\+\"/FlexLove._VERSION = \"$VERSION\"/" FlexLove.lua +rm FlexLove.lua.bak + +# Show the changes +echo "" +echo "Changes made:" +git diff README.md FlexLove.lua + +# Ask for confirmation +echo "" +read -p "Do you want to commit these changes and create a release? (y/n) " -n 1 -r +echo +if [[ ! $REPLY =~ ^[Yy]$ ]]; then + echo "Release cancelled. Restoring original files..." + git checkout README.md FlexLove.lua + exit 1 +fi + +# Commit the changes +echo "Committing version bump..." +git add README.md FlexLove.lua +git commit -m "Bump version to v$VERSION" + +# Create git tag +echo "Creating git tag v$VERSION..." +git tag -a "v$VERSION" -m "Release v$VERSION" + +# Push changes and tags +echo "Pushing to remote..." +git push origin main +git push origin "v$VERSION" + +# Create GitHub release +echo "Creating GitHub release..." +gh release create "v$VERSION" \ + --title "v$VERSION" \ + --generate-notes + +echo "" +echo "✅ Release v$VERSION completed successfully!" +echo " - README.md and FlexLove.lua updated" +echo " - Git tag v$VERSION created" +echo " - GitHub release created"