-
Notifications
You must be signed in to change notification settings - Fork 2
48 lines (40 loc) · 1.48 KB
/
python-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
46
47
48
name: Publish JsonPreprocessor to PyPI
on:
push:
tags:
- "rel/*.*.*"
- "rel/*.*.*.*"
jobs:
build-n-publish:
name: Build and publish to PyPI
runs-on: ubuntu-latest
steps:
- name: Checkout source
uses: actions/checkout@v2
- name: Set up Python
uses: actions/[email protected]
with:
python-version: "3.9"
- name: Install dependencies
run: |
sudo apt-get install -y pandoc
sudo apt-get install -y texlive-latex-*
echo "GENDOC_LATEXPATH=$(dirname $(which pdflatex))" >> $GITHUB_ENV
python -m pip install --upgrade build twine wheel GenPackageDoc PythonExtensionsCollection
- name: Build source and wheel distributions
run: |
python setup.py sdist bdist_wheel
twine check --strict dist/*
- name: Publish distribution to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }} # This token should be created in Settings > Secrets > Actions
# repository_url: https://test.pypi.org/legacy/ # Use this for testing to upload the distribution to test.pypi
- name: Create/Update GitHub Release
id: create_update_release
uses: ncipollo/release-action@v1
with:
allowUpdates: true
omitNameDuringUpdate: true
makeLatest: true
artifacts: dist/*