Fixing PyPI deployment #45
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build | |
on: | |
push: | |
jobs: | |
build_wheel: | |
name: Build Python 3 wheel | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
python: ['3.10'] | |
include: | |
- os: ubuntu-20.04 | |
arch: "x86_64" | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Set up Python ${{ matrix.python }} | |
uses: actions/setup-python@v3 | |
with: | |
python-version: ${{ matrix.python }} | |
- name: Build wheel | |
run: | | |
python -m pip install build | |
python -m build --wheel . | |
- name: Save sdist | |
uses: actions/upload-artifact@v4 | |
with: | |
name: artifact | |
path: dist/*.whl | |
if-no-files-found: error | |
upload_pypi_test: | |
name: Upload to PyPI test | |
needs: [build_wheel] | |
runs-on: ubuntu-latest | |
environment: | |
name: pypi | |
url: https://test.pypi.org/p/interbasepython | |
permissions: | |
id-token: write | |
if: github.ref == 'refs/heads/main' | |
steps: | |
- uses: actions/download-artifact@v4 | |
with: | |
name: artifact | |
path: dist | |
- name: Publish package to TestPyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
repository_url: https://test.pypi.org/legacy/ | |
upload_pypi: | |
name: Upload to PyPI | |
needs: [build_wheel] | |
runs-on: ubuntu-latest | |
environment: | |
name: pypi | |
url: https://pypi.org/p/interbasepython | |
permissions: | |
id-token: write | |
if: startsWith(github.ref, 'refs/tags/v') | |
steps: | |
- uses: actions/download-artifact@v4 | |
with: | |
name: artifact | |
path: dist | |
- name: Publish package to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
upload_gh_pages: | |
name: Deploy to GitHub Pages | |
needs: [upload_pypi] | |
runs-on: windows-latest | |
if: startsWith(github.ref, 'refs/tags/v') | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Publish docs | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
publish_branch: gh-pages | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: docs/ | |
force_orphan: true |