diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml index 6984aab..f82e6df 100644 --- a/.gitea/workflows/build.yaml +++ b/.gitea/workflows/build.yaml @@ -10,7 +10,7 @@ jobs: url: https://pypi.org/p/ steps: - name: Info - run: echo "OS=${{ runner.os }} NAME=${{ gitea.event_name }} REPO=${{ gitea.repository }} BRANCH=${{ gitea.ref }} ST=${{ job.status }}" + run: echo "OS=${{ runner.os }} NAME=${{ gitea.event_name }} REPO=${{ gitea.repository }} BRANCH=${{ gitea.ref }} ST=${{ job.status }} RUNID=${{ gitea.run_id }}" - name: Prepare Source run: | echo "--- write source ---" @@ -28,6 +28,9 @@ jobs: python3 -m pip install setuptools wheel twine -i https://pypi.tuna.tsinghua.edu.cn/simple - name: CheckOut uses: http://hmtsai.cn:3000/actions/checkout@v4 + - name: Write Config + run: | + echo "${{ gitea.run_id }}">runid.conf - name: Build run: python3 setup.py sdist bdist_wheel - name: Check diff --git a/setup.py b/setup.py index 71d6236..f74224f 100644 --- a/setup.py +++ b/setup.py @@ -1,17 +1,31 @@ import sys +import os from setuptools import setup, find_packages + +####### config ####### VERSION = "0.0.2" -pywin32_need = ([] if sys.platform.startswith("linux") else ["pywin32"]) +###################### + +set_v = VERSION +if (os.path.exists("runid.conf")): + with open("runid.conf", "r") as file: + runid = file.read() + set_v = set_v+"."+runid +else: + set_v = set_v+"."+"1000" + +print("BUILD: version="+set_v) + setup( name="magictk", - version=VERSION, + version=set_v, packages=( find_packages(where="./magictk") ), package_dir={ "magictk": "./magictk", }, - install_requires=[]+pywin32_need, + install_requires=["pywin32"], author='cxykevin|git.hmtsai.cn', author_email='cxykevin@yeah.net', description='A tkinter weights looks like element-plus',