diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index bad7cb3..e0c0800 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -11,7 +11,7 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set up Python uses: actions/setup-python@v4 @@ -22,7 +22,7 @@ jobs: uses: actions/cache@v3 with: path: ~/.cache/pip - key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} + key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt', '**/requirements-dev.txt') }} restore-keys: | ${{ runner.os }}-pip- diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 15ca261..b895907 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -21,6 +21,7 @@ jobs: contents: write issues: write pull-requests: write + actions: write steps: - name: Checkout code @@ -31,7 +32,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v4 with: - python-version: '3.12' + python-version: '3.12' - name: Install dependencies run: | @@ -48,7 +49,7 @@ jobs: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | if [ "${{ github.event.inputs.dry-run }}" = "true" ]; then - semantic-release publish --dry-run + semantic-release publish --dry-run --verbose else - semantic-release publish + semantic-release publish --verbose fi diff --git a/early_stopping_pytorch/early_stopping.py b/early_stopping_pytorch/early_stopping.py index 1ee059e..bf9ba2f 100644 --- a/early_stopping_pytorch/early_stopping.py +++ b/early_stopping_pytorch/early_stopping.py @@ -1,6 +1,4 @@ -# pytorchtools.py -__version__ = "0.1.0" - +# early_stopping.py import numpy as np import torch diff --git a/pyproject.toml b/pyproject.toml index 22f9c66..98d4951 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,23 +4,22 @@ build-backend = "setuptools.build_meta" [project] name = "early-stopping-pytorch" -version = "0.1.0" description = "A PyTorch utility package for Early Stopping" readme = "README.md" authors = [ { name = "Bjarte Sunde", email = "BjarteSunde@outlook.com" } ] -license = { text = "MIT" } # Update if you use a different license +license = { text = "MIT" } dependencies = [ "numpy>=1.21", "torch>=1.9.0" ] [tool.semantic_release] -version_variable = [ - "early_stopping_pytorch/__init__.py:__version__", - "pyproject.toml:project.version" -] +version_variable = "early_stopping_pytorch/__init__.py:__version__" branch = "main" upload_to_pypi = false build_command = "pip install build && python -m build" + +[tool.semantic_release.git] +tag_format = "v{version}"