Skip to content

Commit 343c166

Browse files
committed
🔨 refactor(upgrade): update publish_pypi.yml config file.
1 parent 2f7b7b6 commit 343c166

1 file changed

Lines changed: 10 additions & 8 deletions

File tree

.github/workflows/publish_pypi.yml

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# @Author: jankincai
22
# @Date: 2024-09-13 10:48:33
33
# @Last Modified by: jankincai
4-
# @Last Modified time: 2025-07-14 11:31:38
4+
# @Last Modified time: 2025-07-14 16:57:55
55

66
# This workflow will upload a Python Package using Twine when a release is created
77
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries
@@ -15,12 +15,9 @@ name: Upload Python Package
1515

1616
on:
1717
push:
18-
# branches: [ "master" ]
19-
# release:
20-
# types: [published]
21-
22-
tags:
23-
- 'v*'
18+
branches: [ "master" ]
19+
release:
20+
types: [published]
2421

2522
permissions:
2623
contents: read
@@ -32,24 +29,29 @@ jobs:
3229

3330
steps:
3431
- uses: actions/checkout@v4
32+
3533
- name: Set up Python
36-
uses: actions/setup-python@v3
34+
uses: actions/setup-python@v5
3735
with:
3836
python-version: '3.x'
3937
cache: 'pip'
38+
4039
- name: Install dependencies
4140
run: |
4241
python -m pip install --upgrade pip
4342
pip install build
4443
sudo apt install libpcap-dev
44+
4545
- name: Build package
4646
run: python -m build -s
47+
4748
- name: Publish package to Test PyPI
4849
uses: pypa/gh-action-pypi-publish@master
4950
with:
5051
user: __token__
5152
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
5253
repository_url: https://test.pypi.org/legacy/
54+
5355
- name: Publish package to PyPI
5456
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
5557
uses: pypa/gh-action-pypi-publish@master

0 commit comments

Comments
 (0)