Skip to content

Commit 4ab3d85

Browse files
authored
Merge pull request #17 from PyThaiNLP/copilot/fix-python-publish-workflow
Modernize pythonpublish.yml workflow
2 parents b801b93 + ecc3842 commit 4ab3d85

1 file changed

Lines changed: 25 additions & 17 deletions

File tree

.github/workflows/pythonpublish.yml

Lines changed: 25 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,30 @@ on:
99

1010
jobs:
1111
deploy:
12-
13-
runs-on: ubuntu-20.04
12+
runs-on: ubuntu-latest
13+
permissions:
14+
contents: read
1415

1516
steps:
16-
- uses: actions/checkout@v2
17-
- name: Set up Python
18-
uses: actions/setup-python@v1
19-
with:
20-
python-version: '3.x'
21-
- name: Install dependencies
22-
run: |
23-
python -m pip install --upgrade pip
24-
pip install setuptools wheel twine
25-
python setup.py sdist bdist_wheel
26-
- name: Publish a Python distribution to PyPI
27-
uses: pypa/gh-action-pypi-publish@release/v1
28-
with:
29-
user: __token__
30-
password: ${{ secrets.PYPI_API_TOKEN }}
17+
- uses: actions/checkout@v4
18+
19+
- name: Set up Python
20+
uses: actions/setup-python@v5
21+
with:
22+
python-version: '3.x'
23+
cache: 'pip'
24+
25+
- name: Install dependencies
26+
run: |
27+
python -m pip install --upgrade pip
28+
pip install setuptools wheel twine
29+
30+
- name: Build package
31+
run: |
32+
python setup.py sdist bdist_wheel
33+
34+
- name: Publish a Python distribution to PyPI
35+
uses: pypa/gh-action-pypi-publish@release/v1
36+
with:
37+
user: __token__
38+
password: ${{ secrets.PYPI_API_TOKEN }}

0 commit comments

Comments
 (0)