From 5d80457066108978b740327d9b458403385b5530 Mon Sep 17 00:00:00 2001 From: scottcorbin Date: Sat, 28 Feb 2026 09:12:51 -0800 Subject: [PATCH] fix: Replace BSD sed with Python for cross-platform version injection The command used to inject the version tag into is specific to BSD/macOS and fails on GNU/Linux and Windows runners in GitHub Actions with 'sed: can't read : No such file or directory'. Using Python string replacement ensures the version tag is correctly injected across all runner environments. --- .github/workflows/build.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c844fb2..337d852 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -46,8 +46,8 @@ jobs: else VERSION="2.1.0-dev-${GITHUB_SHA::8}" # Default or non-tag build version fi - # Use sed to directly update __version__ in __init__.py - sed -i "" -e "s/__version__ = '.*'/__version__ = '$VERSION'/" src/shortcircuit/__init__.py + # Update __version__ in __init__.py using python for cross-platform compatibility + python -c "import re; f='src/shortcircuit/__init__.py'; c=open(f).read(); open(f,'w').write(re.sub(r\"__version__ = '.*'\", f\"__version__ = '{VERSION}'\", c))" echo "Version set to $VERSION in src/shortcircuit/__init__.py" - name: Build Application @@ -105,8 +105,8 @@ jobs: else VERSION="2.1.0-dev-${GITHUB_SHA::8}" # Default or non-tag build version fi - # Use sed to directly update __version__ in __init__.py - sed -i "" -e "s/__version__ = '.*'/__version__ = '$VERSION'/" src/shortcircuit/__init__.py + # Update __version__ in __init__.py using python for cross-platform compatibility + python -c "import re; f='src/shortcircuit/__init__.py'; c=open(f).read(); open(f,'w').write(re.sub(r\"__version__ = '.*'\", f\"__version__ = '{VERSION}'\", c))" echo "Version set to $VERSION in src/shortcircuit/__init__.py" - name: Build Application