Skip to content

Commit b26eb42

Browse files
committed
V4.0.1
1 parent cfe2f42 commit b26eb42

File tree

1 file changed

+34
-11
lines changed

1 file changed

+34
-11
lines changed

.github/workflows/workflow.yml

Lines changed: 34 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ jobs:
1010
test:
1111
name: Test Python ${{ matrix.python-version }}
1212
runs-on: ubuntu-latest
13+
if: "!startsWith(github.ref, 'refs/tags/')"
1314
strategy:
1415
fail-fast: false
1516
matrix:
@@ -41,11 +42,11 @@ jobs:
4142
token: ${{ secrets.CODECOV_TOKEN }}
4243
slug: ddc/pythonLogs
4344

44-
4545
build:
4646
name: Build Package Python ${{ matrix.python-version }}
4747
runs-on: ubuntu-latest
4848
needs: test
49+
if: "!startsWith(github.ref, 'refs/tags/')"
4950
strategy:
5051
matrix:
5152
python-version: ["3.10", "3.11", "3.12", "3.13"]
@@ -77,23 +78,36 @@ jobs:
7778
retention-days: 7
7879

7980
release:
80-
name: Create Release
81+
name: Build and Release
8182
runs-on: ubuntu-latest
82-
needs: build
8383
if: startsWith(github.ref, 'refs/tags/v')
8484
permissions:
8585
contents: write
86+
strategy:
87+
matrix:
88+
python-version: ["3.10", "3.11", "3.12", "3.13"]
8689
steps:
8790
- uses: actions/checkout@v4
8891

89-
- name: Download package artifacts
90-
uses: actions/download-artifact@v4
92+
- name: Set up Python ${{ matrix.python-version }}
93+
uses: actions/setup-python@v5
9194
with:
92-
pattern: python-package-*
93-
path: dist
94-
merge-multiple: false
95+
python-version: ${{ matrix.python-version }}
96+
97+
- name: Install Poetry
98+
uses: snok/install-poetry@v1
99+
with:
100+
virtualenvs-create: true
101+
virtualenvs-in-project: true
102+
103+
- name: Install build dependencies only
104+
run: poetry install --only main --no-interaction --no-ansi
105+
106+
- name: Build package
107+
run: poetry build
95108

96-
- name: Create Release
109+
- name: Upload to release
110+
if: matrix.python-version == '3.13'
97111
uses: softprops/action-gh-release@v2
98112
with:
99113
name: Release ${{ github.ref_name }}
@@ -104,6 +118,13 @@ jobs:
104118
dist/*.whl
105119
dist/*.tar.gz
106120
121+
- name: Upload artifacts for PyPI
122+
uses: actions/upload-artifact@v4
123+
with:
124+
name: python-package-${{ matrix.python-version }}
125+
path: dist/
126+
retention-days: 7
127+
107128
publish:
108129
name: Publish to PyPI
109130
runs-on: ubuntu-latest
@@ -118,23 +139,25 @@ jobs:
118139
with:
119140
pattern: python-package-*
120141
path: dist
121-
merge-multiple: false
142+
merge-multiple: true
122143

123144
- name: Install twine
124145
run: pip install twine
125146

126147
- name: Verify package
127-
run: twine check dist/*
148+
run: twine check dist/*.whl dist/*.tar.gz
128149

129150
- name: Publish to TestPyPI
130151
uses: pypa/gh-action-pypi-publish@release/v1
131152
with:
132153
repository-url: https://test.pypi.org/legacy/
154+
packages-dir: dist/
133155
skip-existing: true
134156
verbose: true
135157

136158
- name: Publish to PyPI
137159
uses: pypa/gh-action-pypi-publish@release/v1
138160
with:
161+
packages-dir: dist/
139162
skip-existing: true
140163
verbose: true

0 commit comments

Comments
 (0)