-
Notifications
You must be signed in to change notification settings - Fork 29
45 lines (37 loc) · 1.17 KB
/
publish-to-pypi.yml
File metadata and controls
45 lines (37 loc) · 1.17 KB
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
45
name: Upload Python Package
on:
push:
branches:
- master
permissions:
contents: read
jobs:
release-build:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.9"
- name: Install build tools
env:
SB_API_KEY: ${{ secrets.SB_API_KEY }}
run: |
export PYPI_REGISTRY=https://$SB_API_KEY.pypimirror.stablebuild.com/2023-12-27/
curl https://$SB_API_KEY.httpcache.stablebuild.com/pip-cache-20231228/https://bootstrap.pypa.io/get-pip.py -o get-pip.py && \
python get-pip.py -i $PYPI_REGISTRY "pip==21.3.1" "setuptools==62.6.0" && \
rm get-pip.py
python -m pip install -i https://$SB_API_KEY.pypimirror.stablebuild.com/2023-01-30/ twine
- name: Build package
run: |
rm -rf build/
rm -rf dist/
python setup.py sdist
- name: Publish package
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: |
python -m twine upload dist/*