diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index c418463..1cd2f59 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -1,11 +1,14 @@ name: Publish Python 🐍 distribution 📦 to PyPI and TestPyPI -on: push +on: + push: + branches: + - main jobs: build: name: Build distribution 📦 - runs-on: ubuntu-latest + runs-on: windows-latest steps: - uses: actions/checkout@v4 @@ -16,9 +19,30 @@ jobs: - name: Install pypa/build run: | python -m pip install --upgrade pip - pip install setuptools wheel twine + pip install setuptools wheel twine build - name: Build a binary wheel and a source tarball - run: python3 setup.py build sdist + run: python3 -m build + - name: Rename the distribution files + run: | + # Get all .whl files in the dist folder + $files = Get-ChildItem -Path .\dist\ -Filter *.whl + + # Loop through each file + foreach ($file in $files) { + # Split the file name by "-" + $nameParts = $file.BaseName -split "-" + + # Replace the third and fourth items by "py3" + $nameParts[2] = "py3" + $nameParts[3] = "py3" + + # Assemble the new file name with new items + $newName = [string]::Join("-", $nameParts) + ".whl" + + # Move the old file to new file name + Move-Item -Path $file.FullName -Destination .\dist\$newName + } + - name: Store the distribution packages uses: actions/upload-artifact@v3 with: diff --git a/pyproject.toml b/pyproject.toml index 5bd759b..a8acd3e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "time-series-anomaly-detector" -version = "0.2.4" +version = "0.2.5" description = "Time Series Anomaly Detector" readme = "README.md" requires-python = ">=3.9.0"