forked from backstage/mkdocs-techdocs-core
-
Notifications
You must be signed in to change notification settings - Fork 0
45 lines (41 loc) · 1.34 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
45
name: TechDocs PyPI Publish main branch
on:
push:
branches: [main]
paths:
- ".github/workflows/pypi-publish.yml"
- "setup.py"
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
python-version: [3.13]
steps:
# Publish mkdocs-techdocs-core to PyPI
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@master
with:
python-version: ${{ matrix.python-version }}
- name: Install pip, setuptools, and wheel
run: python -m pip install --upgrade pip setuptools wheel
- name: Build Python distribution
working-directory: .
run: |
rm -rf dist
python setup.py bdist_wheel sdist --formats tar
pushd dist >/dev/null || exit
distrib=$(ls *.tar); distrib=${distrib/.tar/}
mkdir -p ${distrib}
cp ../requirements.txt ${distrib}
tar rvf ${distrib}.tar ${distrib}/requirements.txt && gzip ${distrib}.tar
rm -fr ${distrib}
popd >/dev/null || exit
- name: Publish a Python distribution to PyPI
uses: pypa/gh-action-pypi-publish@v1.12.2
with:
user: __token__
password: ${{ secrets.PYPI_API_KEY }}
packages_dir: ./dist