Skip to content

Commit

Permalink
new
Browse files Browse the repository at this point in the history
  • Loading branch information
hiddify-com committed Mar 12, 2023
1 parent 8a64b3b commit df1774d
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 3 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,14 @@ jobs:

steps:
- uses: actions/checkout@v3
- name: convert to pyx
run: |
for f in "hiddifypanel/panel/hiddify.py" "hiddifypanel/panel/admin/UserAdmin.py" "hiddifypanel/panel/admin/ProxyDetailsAdmin.py" $(find hiddifypanel/panel/api/ hiddifypanel/models/ hiddifypanel/panel/telegrambot/ -name "*.py");do
mv $f ${f}x;
echo "#واقعا برای 5 دلار میخوای کرک میکنی؟ حاجی ارزش وقت خودت بیشتره" > $(dirname $f)/read.py
echo "#You want to crack it only for 5\$?" >> $(dirname $f)/read.py
done
- name: Build wheels
uses: pypa/[email protected]
env:
Expand Down
8 changes: 8 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,11 @@ graft tests
graft hiddifypanel
graft hiddifypanel/static
include hiddifypanel/static
global-include */templates/*

#exclude hiddifypanel/base2.c
#exclude hiddifypanel/base2.pyx
global-exclude *.pyx
global-exclude *.c
global-exclude */__pycache__/*
global-include *.so
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ requires = [
"Cython",

]
build-backend = "setuptools.build_meta"
build-backend = "setuptools.build_meta"
17 changes: 17 additions & 0 deletions release.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,28 @@
#!/bin/bash

#python3 setup.py build_ext --inplace
if [ "$(id -u)" -ne 0 ]; then
echo 'This script must be run by root' >&2
exit 1
fi
source .env
make release

rm -rf build/; rm -rf dist/;
rm -rf release
cp -rf ./ release
cd release
for f in "hiddifypanel/panel/hiddify.py" "hiddifypanel/panel/admin/UserAdmin.py" "hiddifypanel/panel/admin/ProxyDetailsAdmin.py" $(find hiddifypanel/panel/api/ hiddifypanel/models/ hiddifypanel/panel/telegrambot/ -name "*.py");do
if [[ $(basename $f) != "__init__.py" ]];then
mv $f ${f}x;
fi
echo "#واقعا برای 5 دلار میخوای کرک میکنی؟ حاجی ارزش وقت خودت بیشتره" > $(dirname $f)/read.py
echo "#You want to crack it only for 5\$?" >> $(dirname $f)/read.py
done

cibuildwheel --platform linux --archs aarch64
# python3 setup.py bdist_wheel build_ext
# exit 1
if [[ $? == "0" ]];then
export TWINE_USERNAME=__token__
export TWINE_PASSWORD=$TWINE_PASSWORD
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ def read_requirements(path):
long_description_content_type="text/markdown",
author="hiddify",
include_package_data=True,
# ext_modules=cythonize(["hiddifypanel/models/__init__.pyx","hiddifypanel/base2.pyx"]),
ext_modules=cythonize(["hiddifypanel/base2.pyx"]),
ext_modules=cythonize(["hiddifypanel/*.pyx","hiddifypanel/*/*.pyx","hiddifypanel/*/*/*.pyx"]),
# ext_modules=cythonize(["hiddifypanel/*.pyx"]),

packages=find_packages(exclude=["tests", ".github"]),
install_requires=read_requirements("requirements.txt"),
Expand Down

0 comments on commit df1774d

Please sign in to comment.