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/.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/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..c059a0a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,17 +6,12 @@ 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.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)