-
Notifications
You must be signed in to change notification settings - Fork 0
44 lines (36 loc) · 1.12 KB
/
pypi-publish.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
name: Publish to PyPI
on:
release:
types:
- created
jobs:
publish:
permissions: write-all
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: 3.10.14
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Build and publish
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
run: |
python setup.py bdist_wheel --version ${{ github.ref_name }}
twine upload dist/*
- name: Upload Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: dist/loguru_cli-${{ github.ref_name }}-py3-none-any.whl
asset_name: loguru_cli-${{ github.ref_name }}-py3-none-any.whl
asset_content_type: application/x-wheel+zip