diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f2de67e..5ff0a08 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,18 +1,17 @@ -name: Semantic Release +name: Create New Release on: - push: - branches: - - main - workflow_dispatch: + workflow_dispatch: # This ensures the workflow is only triggered manually jobs: release: + name: Create Release runs-on: ubuntu-latest - concurrency: release permissions: - id-token: write contents: write + issues: write + pull-requests: write + actions: write steps: - name: Checkout code @@ -21,7 +20,6 @@ jobs: fetch-depth: 0 - name: Python Semantic Release - id: release uses: python-semantic-release/python-semantic-release@v9.12.0 with: github_token: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 8a95a41..7e9b9e6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,6 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "early-stopping-pytorch" +dynamic = ["version"] description = "A PyTorch utility package for Early Stopping" readme = "README.md" authors = [ @@ -15,8 +16,11 @@ dependencies = [ "torch>=1.9.0" ] +[tool.setuptools.dynamic] +version = {attr = "early_stopping_pytorch.__version__"} + [tool.semantic_release] -version_variable = "early_stopping_pytorch/__init__.py:__version__" +version_variable = ["early_stopping_pytorch/__init__.py:__version__"] branch = "main" upload_to_pypi = false build_command = "pip install build && python -m build"