-
Notifications
You must be signed in to change notification settings - Fork 1
45 lines (36 loc) · 948 Bytes
/
publish-to-pypi.yml
File metadata and controls
45 lines (36 loc) · 948 Bytes
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 Python package to PyPI - JianboHIT
on:
workflow_dispatch:
push:
tags:
- 'v*'
jobs:
build-and-publish:
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python 3.8
uses: actions/setup-python@v5
with:
python-version: '3.8'
- name: Install build and twine
run: |
python -m pip install --upgrade pip
pip install setuptools build twine
- name: Install package dependencies
run: |
pip install -e .
- name: Build package
run: |
python -m build
- name: Check package with twine
run: |
twine check dist/*
- name: Publish to PyPI
if: success()
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.JIANBOHIT_PYPI_API_TOKEN }}
repository-url: https://upload.pypi.org/legacy/