From 9d10b0db2341775f6a8d4ddc5e127582402f70a1 Mon Sep 17 00:00:00 2001 From: M Laraib Ali Date: Mon, 22 Sep 2025 23:23:49 +0500 Subject: [PATCH 1/2] update build to extract act executable in wheel bin --- .github/ci-scripts/build.bash | 4 ++-- act/__init__.py | 12 ------------ {act => bin}/act | 0 pyproject.toml | 12 +++++------- 4 files changed, 7 insertions(+), 21 deletions(-) delete mode 100644 act/__init__.py rename {act => bin}/act (100%) diff --git a/.github/ci-scripts/build.bash b/.github/ci-scripts/build.bash index f9a4e90..3e41879 100755 --- a/.github/ci-scripts/build.bash +++ b/.github/ci-scripts/build.bash @@ -48,8 +48,7 @@ act_bin="$(find "$platform_dir" -type f -name 'act*' -print -quit)" if [[ -z "$act_bin" ]]; then echo "WARNING: Could not locate act binary inside $ASSET" >&2 else - cp "$act_bin" "act/act" - chmod +x "act/act" + cp "$act_bin" "bin/" fi # Copy README and LICENSE if they exist @@ -65,3 +64,4 @@ rm -rf dist uv build --wheel uvx wheel tags --remove --platform-tag "$PLATFORM" dist/*.whl mv dist/*.whl wheels/ +rm -f bin/* diff --git a/act/__init__.py b/act/__init__.py deleted file mode 100644 index 06c7201..0000000 --- a/act/__init__.py +++ /dev/null @@ -1,12 +0,0 @@ -import os -import subprocess -import sys - - -def main() -> None: - result = subprocess.run( - [os.path.dirname(__file__) + "/act"] + sys.argv[1:], - stdout=sys.stdout, - stderr=sys.stderr, - ) - sys.exit(result.returncode) diff --git a/act/act b/bin/act similarity index 100% rename from act/act rename to bin/act diff --git a/pyproject.toml b/pyproject.toml index a43e638..bbd739f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,17 +6,15 @@ readme = "README.md" license = "MIT" requires-python = ">=3" -[project.scripts] -act = "act:main" - [build-system] requires = ["setuptools>=61"] build-backend = "setuptools.build_meta" [tool.setuptools] -include-package-data = true -packages = ["act"] -[tool.setuptools.package-data] -act = ["act"] +packages = [] + +[tool.setuptools.data-files] +"bin" = ["bin/*"] + [tool.setuptools.dynamic] version = {file = ["VERSION"]} From 8c946996626cc96446158d2ac6e006db0684ca9c Mon Sep 17 00:00:00 2001 From: M Laraib Ali Date: Tue, 23 Sep 2025 00:13:59 +0500 Subject: [PATCH 2/2] separate testing step for windows --- .github/workflows/release-workflow.yml | 6 ++++++ pyproject.toml | 3 --- setup.py | 12 ++++++++++++ 3 files changed, 18 insertions(+), 3 deletions(-) create mode 100644 setup.py diff --git a/.github/workflows/release-workflow.yml b/.github/workflows/release-workflow.yml index b939c82..7e87131 100644 --- a/.github/workflows/release-workflow.yml +++ b/.github/workflows/release-workflow.yml @@ -70,18 +70,24 @@ jobs: - name: Build Windows arm64 continue-on-error: true + env: + SYS_PLATFORM: win32 run: .github/ci-scripts/build.bash -a assets/act_Windows_arm64.zip -p win_arm64 - name: Build Windows 32-bit continue-on-error: true + env: + SYS_PLATFORM: win32 run: .github/ci-scripts/build.bash -a assets/act_Windows_i386.zip -p win32 - name: Build Windows 64-bit continue-on-error: true + env: + SYS_PLATFORM: win32 run: .github/ci-scripts/build.bash -a assets/act_Windows_x86_64.zip -p win_amd64 diff --git a/pyproject.toml b/pyproject.toml index bbd739f..c059a0a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -13,8 +13,5 @@ build-backend = "setuptools.build_meta" [tool.setuptools] packages = [] -[tool.setuptools.data-files] -"bin" = ["bin/*"] - [tool.setuptools.dynamic] version = {file = ["VERSION"]} diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..e0314dc --- /dev/null +++ b/setup.py @@ -0,0 +1,12 @@ +import glob +import os +import sys + +import setuptools + +if sys.platform == "win32" or os.getenv("SYS_PLATFORM") == "win32": + data_files = [("Scripts", glob.glob("bin/*.exe"))] +else: + data_files = [("bin", glob.glob("bin/*"))] + +setuptools.setup(data_files=data_files)