Skip to content

Commit 01e26f0

Browse files
committed
V4.0.1
1 parent 66f0c8a commit 01e26f0

34 files changed

+6773
-921
lines changed

.github/workflows/tests.yml

Lines changed: 0 additions & 46 deletions
This file was deleted.

.github/workflows/workflow.yml

Lines changed: 96 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -1,113 +1,139 @@
1-
name: Test, Build, Release, Publish
1+
name: CI/CD Pipeline
22

33
on:
44
push:
5-
branches:
6-
- master
7-
- main
5+
branches: [main, master]
6+
tags: ['v*']
7+
pull_request:
8+
branches: [main, master]
89

910
jobs:
10-
test_and_build:
11+
test:
12+
name: Test Python ${{ matrix.python-version }}
1113
runs-on: ubuntu-latest
1214
strategy:
15+
fail-fast: false
1316
matrix:
14-
python-version: ["3.x"]
17+
python-version: ["3.10", "3.11", "3.12", "3.13"]
1518
steps:
16-
- uses: actions/checkout@master
19+
- uses: actions/checkout@v4
1720

1821
- name: Set up Python ${{ matrix.python-version }}
19-
uses: actions/setup-python@master
22+
uses: actions/setup-python@v5
2023
with:
2124
python-version: ${{ matrix.python-version }}
25+
cache: 'poetry'
2226

2327
- name: Install Poetry
24-
run: |
25-
python -m pip install --upgrade pip setuptools wheel
26-
python -m pip install poetry
28+
uses: snok/install-poetry@v1
29+
with:
30+
virtualenvs-create: true
31+
virtualenvs-in-project: true
2732

28-
- name: Install poetry dependencies
29-
run: |
30-
python -m poetry update --with test
33+
- name: Install dependencies
34+
run: poetry install --with test --no-interaction --no-ansi
3135

32-
- name: Run tests
33-
run: |
34-
python -m poetry run coverage run --omit=./tests/* -m pytest -v
36+
- name: Run tests with coverage
37+
run: poetry run poe tests
3538

36-
- name: Generate Coverage Report
37-
run: |
38-
python -m poetry run coverage report
39-
python -m poetry run coverage xml
39+
- name: Upload coverage to Codecov
40+
if: matrix.python-version == '3.13'
41+
uses: codecov/codecov-action@v4
42+
with:
43+
token: ${{ secrets.CODECOV_TOKEN }}
44+
file: ./coverage.xml
45+
flags: unittests
46+
name: coverage-py${{ matrix.python-version }}
4047

41-
- name: Upload coverage reports to Codecov
42-
uses: codecov/codecov-action@v5
48+
build:
49+
name: Build Package
50+
runs-on: ubuntu-latest
51+
needs: test
52+
steps:
53+
- uses: actions/checkout@v4
54+
55+
- name: Set up Python
56+
uses: actions/setup-python@v5
4357
with:
44-
token: ${{ secrets.CODECOV_TOKEN }}
45-
slug: ddc/pythonLogs
58+
python-version: '3.13'
59+
cache: 'poetry'
60+
61+
- name: Install Poetry
62+
uses: snok/install-poetry@v1
63+
with:
64+
virtualenvs-create: true
65+
virtualenvs-in-project: true
66+
67+
- name: Install build dependencies only
68+
run: poetry install --only main --no-interaction --no-ansi
4669

4770
- name: Build package
48-
run: |
49-
python -m poetry build
71+
run: poetry build
5072

51-
- name: Store the distribution packages to publish to pypi
52-
uses: actions/upload-artifact@master
73+
- name: Upload artifacts
74+
uses: actions/upload-artifact@v4
5375
with:
54-
name: python-package-distributions
76+
name: python-package
5577
path: dist/
78+
retention-days: 7
5679

5780
release:
81+
name: Create Release
5882
runs-on: ubuntu-latest
59-
needs:
60-
- test_and_build
61-
env:
62-
GITHUB_TOKEN: ${{ github.token }}
83+
needs: build
84+
if: startsWith(github.ref, 'refs/tags/v')
6385
permissions:
6486
contents: write
65-
pull-requests: read
6687
steps:
67-
- id: release
68-
uses: rymndhng/release-on-push-action@master
88+
- uses: actions/checkout@v4
89+
90+
- name: Download package artifacts
91+
uses: actions/download-artifact@v4
6992
with:
70-
bump_version_scheme: patch # major | minor | patch
71-
tag_prefix: v
72-
release_name: "Version <RELEASE_VERSION>"
73-
release_body: ${{ steps.release.outputs.tag_name }}
74-
75-
- name: Check Output Parameters
76-
run: |
77-
echo "Got tag name ${{ steps.release.outputs.tag_name }}"
78-
echo "Got release version ${{ steps.release.outputs.version }}"
79-
echo "Upload release artifacts to ${{ steps.release.outputs.upload_url }}"
80-
81-
publish-to-test-pypi:
93+
name: python-package
94+
path: dist
95+
96+
- name: Create Release
97+
uses: softprops/action-gh-release@v2
98+
with:
99+
name: Release ${{ github.ref_name }}
100+
body: Automated release for version ${{ github.ref_name }}
101+
draft: false
102+
prerelease: false
103+
files: |
104+
dist/*.whl
105+
dist/*.tar.gz
106+
107+
publish:
108+
name: Publish to PyPI
82109
runs-on: ubuntu-latest
110+
needs: release
111+
if: startsWith(github.ref, 'refs/tags/v')
83112
environment: release
84-
needs:
85-
- release
86113
permissions:
87114
id-token: write
88115
steps:
89-
- name: Download all the dists
90-
uses: actions/download-artifact@master
116+
- name: Download package artifacts
117+
uses: actions/download-artifact@v4
91118
with:
92-
name: python-package-distributions
93-
path: dist/
94-
- name: Publish distribution to TestPyPI
119+
name: python-package
120+
path: dist
121+
122+
- name: Install twine
123+
run: pip install twine
124+
125+
- name: Verify package
126+
run: twine check dist/*
127+
128+
- name: Publish to TestPyPI
95129
uses: pypa/gh-action-pypi-publish@release/v1
96130
with:
97131
repository-url: https://test.pypi.org/legacy/
132+
skip-existing: true
133+
verbose: true
98134

99-
publish-to-pypi:
100-
runs-on: ubuntu-latest
101-
environment: release
102-
needs:
103-
- release
104-
permissions:
105-
id-token: write
106-
steps:
107-
- name: Download all the dists
108-
uses: actions/download-artifact@master
109-
with:
110-
name: python-package-distributions
111-
path: dist/
112-
- name: Publish distribution to PyPI
135+
- name: Publish to PyPI
113136
uses: pypa/gh-action-pypi-publish@release/v1
137+
with:
138+
skip-existing: true
139+
verbose: true

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,3 +158,4 @@ cython_debug/
158158
# and can be added to the global gitignore or merged into this file. For a more nuclear
159159
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
160160
.idea/
161+
/package-lock.json

0 commit comments

Comments
 (0)