Skip to content

Commit 7659d36

Browse files
authored
update release workflow (#109)
1 parent a213059 commit 7659d36

File tree

1 file changed

+19
-34
lines changed

1 file changed

+19
-34
lines changed

.github/workflows/pypi_release.yml

Lines changed: 19 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -5,46 +5,31 @@
55

66
name: Pypi Release
77

8-
on:
8+
on:
99
release:
1010
types: [created]
1111

1212
jobs:
13-
build:
14-
name: Build distribution
15-
runs-on: ubuntu-latest
16-
17-
steps:
18-
- uses: actions/checkout@v4
19-
- uses: actions/setup-python@v5
20-
with:
21-
python-version: "3.x"
22-
- name: Install Dependency
23-
run: python -m pip install -U build
24-
- name: Build Distribution Pakcage
25-
run: python -m build
26-
- name: Store the distribution packages
27-
uses: actions/upload-artifact@v4
28-
with:
29-
name: python-package-distributions
30-
path: dist/
13+
deploy:
3114

32-
publish-to-pypi:
33-
name: Publish to PyPI
34-
needs:
35-
- build
3615
runs-on: ubuntu-latest
37-
environment:
38-
name: pypi
3916

4017
steps:
41-
- name: Download all the dists
42-
uses: actions/download-artifact@v4
43-
with:
44-
name: python-package-distributions
45-
path: dist/
46-
- name: Publish distribution to PyPI
47-
uses: pypa/gh-action-pypi-publish@release/v1
18+
- uses: actions/checkout@v4
19+
- name: Set up Python
20+
uses: actions/setup-python@v5
4821
with:
49-
username: __token__
50-
password: ${{ secrets.PYPI_TOKEN }}
22+
python-version: '3.10'
23+
- name: Install dependencies
24+
run: |
25+
python -m pip install --upgrade pip
26+
pip install build twine
27+
- name: Build and publish
28+
env:
29+
TWINE_USERNAME: ${{ secrets. PYPI_USERNAME }}
30+
TWINE_PASSWORD: ${{ secrets. PYPI_PASSWORD }}
31+
RELEASE: 1
32+
33+
run: |
34+
python -m build
35+
twine upload dist/* --verbose

0 commit comments

Comments
 (0)