2023-02-28 17:14:59 +00:00
|
|
|
name: Publish
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- "main"
|
|
|
|
paths-ignore:
|
|
|
|
- 'README.md'
|
|
|
|
- 'LICENSE.md'
|
|
|
|
- 'CHANGELOG.md'
|
|
|
|
- '.gitignore'
|
|
|
|
- 'renovate.json'
|
|
|
|
- 'CODEOWNERS'
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Check out repository code
|
2024-04-25 01:02:50 +00:00
|
|
|
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
|
2023-02-28 17:14:59 +00:00
|
|
|
- name: Setup Python
|
2023-12-10 14:46:59 +00:00
|
|
|
uses: actions/setup-python@v5
|
2023-02-28 17:14:59 +00:00
|
|
|
with:
|
|
|
|
python-version: "3.11"
|
|
|
|
- name: Install dependencies
|
|
|
|
run: |
|
|
|
|
pip install -r requirements.txt
|
|
|
|
pip install -r requirements-dev.txt
|
|
|
|
pip install setuptools wheel
|
|
|
|
- name: Build wheel file
|
|
|
|
run: python setup.py bdist_wheel
|
|
|
|
- id: skip_check
|
2023-12-14 21:01:52 +00:00
|
|
|
uses: actions/upload-artifact@v4
|
2023-02-28 17:14:59 +00:00
|
|
|
with:
|
|
|
|
name: whl
|
|
|
|
path: dist/
|
|
|
|
|
|
|
|
publish:
|
|
|
|
needs: build
|
|
|
|
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Create dist folder
|
|
|
|
run: |
|
|
|
|
mkdir -p dist
|
2023-12-14 19:53:45 +00:00
|
|
|
- uses: actions/download-artifact@v4
|
2023-02-28 17:14:59 +00:00
|
|
|
with:
|
|
|
|
name: whl
|
|
|
|
path: dist
|
|
|
|
- name: Publish to PyPI
|
|
|
|
uses: pypa/gh-action-pypi-publish@release/v1
|
|
|
|
with:
|
|
|
|
user: __token__
|
|
|
|
password: ${{ secrets.PYPI_API_TOKEN }}
|