Skip to content

Commit

Permalink
update cd flow & version
Browse files Browse the repository at this point in the history
  • Loading branch information
juaduan committed May 31, 2024
1 parent 1efb7b0 commit 4951662
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 5 deletions.
32 changes: 28 additions & 4 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 4951662

Please sign in to comment.