Skip to content

Commit 8bf28bd

Browse files
authored
V4.0.1 (#1)
* V4.0.1 * V4.0.1 * V4.0.1 * V4.0.1 * V4.0.1 * V4.0.1 * V4.0.1 * V4.0.1 * V4.0.1 --------- Co-authored-by: ddc <[email protected]>
1 parent 66f0c8a commit 8bf28bd

34 files changed

+6773
-918
lines changed

.github/workflows/tests.yml

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

.github/workflows/workflow.yml

Lines changed: 96 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -1,113 +1,142 @@
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]
9+
810

911
jobs:
10-
test_and_build:
12+
test:
13+
name: Test Python ${{ matrix.python-version }}
1114
runs-on: ubuntu-latest
1215
strategy:
16+
fail-fast: false
1317
matrix:
14-
python-version: ["3.x"]
18+
python-version: ["3.10", "3.11", "3.12", "3.13"]
1519
steps:
16-
- uses: actions/checkout@master
20+
- uses: actions/checkout@v4
1721

1822
- name: Set up Python ${{ matrix.python-version }}
19-
uses: actions/setup-python@master
23+
uses: actions/setup-python@v5
2024
with:
2125
python-version: ${{ matrix.python-version }}
2226

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

32-
- name: Run tests
33-
run: |
34-
python -m poetry run coverage run --omit=./tests/* -m pytest -v
33+
- name: Install dependencies
34+
run: poetry install --with test --no-interaction --no-ansi
3535

36-
- name: Generate Coverage Report
37-
run: |
38-
python -m poetry run coverage report
39-
python -m poetry run coverage xml
36+
- name: Run tests with coverage
37+
run: poetry run poe tests
4038

4139
- name: Upload coverage reports to Codecov
40+
if: matrix.python-version == '3.13'
4241
uses: codecov/codecov-action@v5
4342
with:
4443
token: ${{ secrets.CODECOV_TOKEN }}
4544
slug: ddc/pythonLogs
4645

46+
47+
build:
48+
name: Build Package Python ${{ matrix.python-version }}
49+
runs-on: ubuntu-latest
50+
needs: test
51+
strategy:
52+
matrix:
53+
python-version: ["3.10", "3.11", "3.12", "3.13"]
54+
steps:
55+
- uses: actions/checkout@v4
56+
57+
- name: Set up Python ${{ matrix.python-version }}
58+
uses: actions/setup-python@v5
59+
with:
60+
python-version: ${{ matrix.python-version }}
61+
62+
- name: Install Poetry
63+
uses: snok/install-poetry@v1
64+
with:
65+
virtualenvs-create: true
66+
virtualenvs-in-project: true
67+
68+
- name: Install build dependencies only
69+
run: poetry install --only main --no-interaction --no-ansi
70+
4771
- name: Build package
48-
run: |
49-
python -m poetry build
72+
run: poetry build
5073

51-
- name: Store the distribution packages to publish to pypi
52-
uses: actions/upload-artifact@master
74+
- name: Upload artifacts
75+
uses: actions/upload-artifact@v4
5376
with:
54-
name: python-package-distributions
77+
name: python-package-${{ matrix.python-version }}
5578
path: dist/
79+
retention-days: 7
5680

5781
release:
82+
name: Create Release
5883
runs-on: ubuntu-latest
59-
needs:
60-
- test_and_build
61-
env:
62-
GITHUB_TOKEN: ${{ github.token }}
84+
needs: build
85+
if: startsWith(github.ref, 'refs/tags/v')
6386
permissions:
6487
contents: write
65-
pull-requests: read
6688
steps:
67-
- id: release
68-
uses: rymndhng/release-on-push-action@master
89+
- uses: actions/checkout@v4
90+
91+
- name: Download package artifacts
92+
uses: actions/download-artifact@v4
93+
with:
94+
pattern: python-package-*
95+
path: dist
96+
merge-multiple: true
97+
98+
- name: Create Release
99+
uses: softprops/action-gh-release@v2
69100
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:
101+
name: Release ${{ github.ref_name }}
102+
body: Automated release for version ${{ github.ref_name }}
103+
draft: false
104+
prerelease: false
105+
files: |
106+
dist/*.whl
107+
dist/*.tar.gz
108+
109+
publish:
110+
name: Publish to PyPI
82111
runs-on: ubuntu-latest
112+
needs: release
113+
if: startsWith(github.ref, 'refs/tags/v')
83114
environment: release
84-
needs:
85-
- release
86115
permissions:
87116
id-token: write
88117
steps:
89-
- name: Download all the dists
90-
uses: actions/download-artifact@master
118+
- name: Download package artifacts
119+
uses: actions/download-artifact@v4
91120
with:
92-
name: python-package-distributions
93-
path: dist/
94-
- name: Publish distribution to TestPyPI
121+
pattern: python-package-*
122+
path: dist
123+
merge-multiple: true
124+
125+
- name: Install twine
126+
run: pip install twine
127+
128+
- name: Verify package
129+
run: twine check dist/*
130+
131+
- name: Publish to TestPyPI
95132
uses: pypa/gh-action-pypi-publish@release/v1
96133
with:
97134
repository-url: https://test.pypi.org/legacy/
135+
skip-existing: true
136+
verbose: true
98137

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
138+
- name: Publish to PyPI
113139
uses: pypa/gh-action-pypi-publish@release/v1
140+
with:
141+
skip-existing: true
142+
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)