From b4016fde5181c2e044c7de83028d0673b2310603 Mon Sep 17 00:00:00 2001 From: Michael Freno Date: Tue, 25 Nov 2025 21:29:43 -0500 Subject: [PATCH] use awk --- .actrc | 7 +++++++ .github/workflows/release.yml | 31 ++++++++++++------------------ scripts/archive-docs.sh | 2 +- scripts/create-profile-packages.sh | 2 +- scripts/create-release.sh | 2 +- scripts/generate_docs.sh | 2 +- scripts/make-tag.sh | 2 +- scripts/test-release-locally.sh | 2 +- 8 files changed, 25 insertions(+), 25 deletions(-) create mode 100644 .actrc diff --git a/.actrc b/.actrc new file mode 100644 index 0000000..4b723ba --- /dev/null +++ b/.actrc @@ -0,0 +1,7 @@ +# Use smaller, more efficient images for act +-P ubuntu-latest=catthehacker/ubuntu:act-latest +-P ubuntu-22.04=catthehacker/ubuntu:act-22.04 +-P ubuntu-20.04=catthehacker/ubuntu:act-20.04 + +# Container architecture for M-series Macs +--container-architecture linux/amd64 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c9c65d9..ed89ba1 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -26,14 +26,23 @@ jobs: VERSION=${GITHUB_REF#refs/tags/v} echo "Triggered by tag: $GITHUB_REF_NAME" else - VERSION=$(grep -m 1 "_VERSION" FlexLove.lua | sed -E 's/.*"([^"]+)".*/\1/') + VERSION=$(grep -m 1 "_VERSION" FlexLove.lua | awk -F'"' '{print $2}') echo "Triggered manually, using FlexLove.lua version" fi - + + # Verify version was extracted + if [ -z "$VERSION" ]; then + echo "ERROR: Failed to extract version from FlexLove.lua" + echo "Looking for line matching: _VERSION" + grep "_VERSION" FlexLove.lua || echo "No _VERSION found" + exit 1 + fi + + echo "Extracted version: $VERSION" echo "version=$VERSION" >> $GITHUB_OUTPUT echo "tag=v${VERSION}" >> $GITHUB_OUTPUT - FLEX_VERSION=$(grep -m 1 "_VERSION" FlexLove.lua | sed -E 's/.*"([^"]+)".*/\1/') + FLEX_VERSION=$(grep -m 1 "_VERSION" FlexLove.lua | awk -F'"' '{print $2}') echo "FlexLove.lua version: $FLEX_VERSION" echo "Release version: $VERSION" @@ -131,22 +140,6 @@ jobs: done echo "✓ All profile packages created successfully" - - name: Upload release artifacts - uses: actions/upload-artifact@v4 - with: - name: release-assets - path: | - releases/flexlove-*-v${{ steps.version.outputs.version }}.zip - releases/flexlove-*-v${{ steps.version.outputs.version }}.zip.sha256 - docs/api.html - retention-days: 90 - - - name: Download release artifacts - uses: actions/download-artifact@v4 - with: - name: release-assets - path: ./ - - name: Extract checksums for release notes id: checksums run: | diff --git a/scripts/archive-docs.sh b/scripts/archive-docs.sh index 90146c9..289463f 100755 --- a/scripts/archive-docs.sh +++ b/scripts/archive-docs.sh @@ -11,7 +11,7 @@ NC='\033[0m' # No Color echo -e "${BLUE}FlexLöve Documentation Archival${NC}" echo "" -VERSION=$(grep -m 1 "_VERSION" FlexLove.lua | sed -E 's/.*"([^"]+)".*/\1/') +VERSION=$(grep -m 1 "_VERSION" FlexLove.lua | awk -F'"' '{print $2}') if [ -z "$VERSION" ]; then echo -e "${RED}Error: Could not extract version from FlexLove.lua${NC}" exit 1 diff --git a/scripts/create-profile-packages.sh b/scripts/create-profile-packages.sh index a63e58a..df656ca 100755 --- a/scripts/create-profile-packages.sh +++ b/scripts/create-profile-packages.sh @@ -11,7 +11,7 @@ NC='\033[0m' # No Color echo -e "${BLUE}FlexLöve Profile Package Builder${NC}" echo "" -VERSION=$(grep -m 1 "_VERSION" FlexLove.lua | sed -E 's/.*"([^"]+)".*/\1/') +VERSION=$(grep -m 1 "_VERSION" FlexLove.lua | awk -F'"' '{print $2}') if [ -z "$VERSION" ]; then echo -e "${RED}Error: Could not extract version from FlexLove.lua${NC}" exit 1 diff --git a/scripts/create-release.sh b/scripts/create-release.sh index c5aa3b1..4739371 100755 --- a/scripts/create-release.sh +++ b/scripts/create-release.sh @@ -11,7 +11,7 @@ NC='\033[0m' # No Color echo -e "${BLUE}FlexLöve Release Builder${NC}" echo "" -VERSION=$(grep -m 1 "_VERSION" FlexLove.lua | sed -E 's/.*"([^"]+)".*/\1/') +VERSION=$(grep -m 1 "_VERSION" FlexLove.lua | awk -F'"' '{print $2}') if [ -z "$VERSION" ]; then echo -e "${RED}Error: Could not extract version from FlexLove.lua${NC}" exit 1 diff --git a/scripts/generate_docs.sh b/scripts/generate_docs.sh index d33d17c..8259576 100755 --- a/scripts/generate_docs.sh +++ b/scripts/generate_docs.sh @@ -13,7 +13,7 @@ cd "$PROJECT_ROOT" if [ -f "docs/api.html" ]; then echo -e "${YELLOW}Checking for previous documentation version...${NC}" OLD_VERSION=$(grep -o 'FlexLöve v[0-9.]*' docs/api.html | head -1 | sed 's/FlexLöve v//') - CURRENT_VERSION=$(grep -m 1 "_VERSION" FlexLove.lua | sed -E 's/.*"([^"]+)".*/\1/') + CURRENT_VERSION=$(grep -m 1 "_VERSION" FlexLove.lua | awk -F'"' '{print $2}') if [ -n "$OLD_VERSION" ] && [ "$OLD_VERSION" != "$CURRENT_VERSION" ]; then echo -e "${YELLOW}Found previous version v${OLD_VERSION}, archiving before generating new docs...${NC}" diff --git a/scripts/make-tag.sh b/scripts/make-tag.sh index 753188d..e39c4ae 100755 --- a/scripts/make-tag.sh +++ b/scripts/make-tag.sh @@ -41,7 +41,7 @@ CURRENT_VERSION=$(git describe --tags --abbrev=0 2>/dev/null | sed 's/^v//') if [ -z "$CURRENT_VERSION" ]; then echo -e "${YELLOW}Warning: No existing git tags found${NC}" echo -e "${YELLOW}Attempting to read version from FlexLove.lua...${NC}" - CURRENT_VERSION=$(grep -m 1 "_VERSION" FlexLove.lua | sed -E 's/.*"([^"]+)".*/\1/') + CURRENT_VERSION=$(grep -m 1 "_VERSION" FlexLove.lua | awk -F'"' '{print $2}') if [ -z "$CURRENT_VERSION" ]; then echo -e "${RED}Error: Could not extract version from git tags or FlexLove.lua${NC}" exit 1 diff --git a/scripts/test-release-locally.sh b/scripts/test-release-locally.sh index b6f2c91..b87c113 100755 --- a/scripts/test-release-locally.sh +++ b/scripts/test-release-locally.sh @@ -18,7 +18,7 @@ echo "" # Step 1: Extract version echo -e "${YELLOW}Step 1: Extract version from FlexLove.lua${NC}" -VERSION=$(grep -m 1 "_VERSION" FlexLove.lua | sed -E 's/.*"([^"]+)".*/\1/') +VERSION=$(grep -m 1 "_VERSION" FlexLove.lua | awk -F'"' '{print $2}') if [ -z "$VERSION" ]; then echo -e "${RED}Error: Could not extract version${NC}" exit 1