diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml index 259c187..304acce 100644 --- a/.github/workflows/pypi.yml +++ b/.github/workflows/pypi.yml @@ -1,7 +1,6 @@ on: - push: - tags: - - '*' + release: + types: [ created ] jobs: Publish: @@ -22,11 +21,6 @@ jobs: pip install build --user - - name: Update version in pyproject.toml - run: >- - sed -i - "s/^version = \".*\"/version = \"${{ github.ref_name }}\"/" - pyproject.toml - name: Build a binary wheel and a source tarball run: >- python -m diff --git a/.gitignore b/.gitignore index 2dc53ca..bc524ab 100644 --- a/.gitignore +++ b/.gitignore @@ -157,4 +157,8 @@ cython_debug/ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore # and can be added to the global gitignore or merged into this file. For a more nuclear # option (not recommended) you can uncomment the following to ignore the entire idea folder. + +# auto-generated by setuptools-scm +src/headless_ida/_version.py + .idea/ diff --git a/pyproject.toml b/pyproject.toml index 1ff7eef..769d8cd 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,10 +1,9 @@ [build-system] -requires = ["setuptools"] +requires = ["setuptools>=43.0.0", "setuptools_scm>=8", "wheel"] build-backend = "setuptools.build_meta" [project] name = "headless-ida" -version = "0.0.0" dependencies = [ "rpyc", ] @@ -16,6 +15,7 @@ authors = [ license = {file = "LICENSE"} keywords = ["ida", "headless", "idapro", "hexrays"] requires-python = ">=3" +dynamic = ["version"] [project.scripts] headless-ida = "headless_ida:headlessida_cli" @@ -28,3 +28,6 @@ repository = "https://github.com/DennyDai/headless-ida" [tool.setuptools.packages.find] where = ["src"] + +[tool.setuptools_scm] +version_file = "src/headless_ida/_version.py"