Skip to content

Commit 2268ac9

Browse files
author
Olivier
committed
update release script
1 parent e4b6321 commit 2268ac9

File tree

1 file changed

+23
-15
lines changed

1 file changed

+23
-15
lines changed

.github/workflows/python-publish.yml

+23-15
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,40 @@
1-
# This workflows will upload a Python Package using Twine when a release is created
2-
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
1+
2+
# This workflow will upload a Python Package using Twine when a release is created
3+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries
4+
5+
# This workflow uses actions that are not certified by GitHub.
6+
# They are provided by a third-party and are governed by
7+
# separate terms of service, privacy policy, and support
8+
# documentation.
39

410
name: Upload Python Package
511

612
on:
7-
push:
8-
tags:
9-
- "v*"
13+
release:
14+
types: [published]
15+
16+
permissions:
17+
contents: read
1018

1119
jobs:
1220
deploy:
1321

1422
runs-on: ubuntu-latest
1523

1624
steps:
17-
- uses: actions/checkout@v2
25+
- uses: actions/checkout@v3
1826
- name: Set up Python
19-
uses: actions/setup-python@v2
27+
uses: actions/setup-python@v3
2028
with:
2129
python-version: '3.x'
2230
- name: Install dependencies
2331
run: |
2432
python -m pip install --upgrade pip
25-
pip install setuptools wheel twine
26-
- name: Build and publish
27-
env:
28-
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
29-
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
30-
run: |
31-
python setup.py sdist bdist_wheel
32-
twine upload dist/*
33+
pip install build
34+
- name: Build package
35+
run: python -m build
36+
- name: Publish package
37+
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
38+
with:
39+
user: __token__
40+
password: ${{ secrets.PYPI_API_TOKEN }}

0 commit comments

Comments
 (0)