Skip to content

Commit 6c6921e

Browse files
committed
actions: fix publish script
- use 'python -m build' for building wheel - update action trigger Signed-off-by: Hiroshi Miura <miurahr@linux.com>
1 parent 3b70fb0 commit 6c6921e

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

.github/workflows/publish-to-test-pypi.yml renamed to .github/workflows/publish-to-pypi.yml

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
11
name: Publish Python 🐍 distributions 📦 to PyPI and TestPyPI
22

3-
on: push
3+
# publish wheels and source to test.pypi.org on releases/* branch
4+
# publish wheels and source to pypi.org when pushing v* tag on master or releasees/* branch
5+
6+
on:
7+
push:
8+
branches:
9+
- master
10+
- releases/*
11+
tags:
12+
- v*
413

514
jobs:
615
build-n-publish:
@@ -18,15 +27,14 @@ jobs:
1827
with:
1928
python-version: 3.9
2029
- name: Install dependency
21-
run: python -m pip install -U pip wheel setuptools setuptools_scm[toml] twine
30+
run: python -m pip install -U pip wheel setuptools setuptools_scm[toml] twine build
2231
- name: Build release assets
2332
run: |
24-
python setup.py sdist
25-
python -m pip wheel .
33+
python -m build --sdist --wheel
2634
- name: twine check
2735
run: python -m twine check dist/*
2836
- name: Publish distribution 📦 to Test PyPI
29-
if: startsWith(github.event.ref, 'refs/heads/master')
37+
if: startsWith(github.event.ref, 'refs/heads/releases/')
3038
uses: pypa/gh-action-pypi-publish@master
3139
with:
3240
password: ${{ secrets.testpypi_password }}

0 commit comments

Comments
 (0)