Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
105 changes: 77 additions & 28 deletions .github/workflows/wf-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,45 +33,94 @@ jobs:
- name: Run build
run: tox -e build

- name: Build doc
run: tox -e doc

- name: Store the distribution packages
uses: actions/upload-artifact@v5
with:
name: build-artifacts-${{ matrix.python-version }}
path: |
dist/
docs/


deploy-docs:
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
strategy:
fail-fast: false
matrix:
python-version: [ "3.10"]
name: Deploy documentation 📚 to GitHub Pages
if: startsWith(github.ref, 'refs/tags/') # only publish documentation on tag pushes
needs:
- build
runs-on: ubuntu-latest
needs: build
permissions:
contents: write
pages: write

environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}

- name: Setup Pages
uses: actions/configure-pages@v4

- name: Upgrade pip
run: python -m pip install --upgrade pip

- name: Install Tox
run: pip install tox
permissions:
contents: write
pages: write

- name: Build Doc
run: tox -e doc
steps:
- name: Download docs build artifacts
uses: actions/download-artifact@v6
with:
name: build-artifacts-3.12
path: docs/

- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
publish_branch: gh-pages
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: docs/_build/html
force_orphan: true
force_orphan: true

publish-to-testpypi:
name: Publish Python 🐍 distribution 📦 to TestPyPI
if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes
needs:
- build
runs-on: ubuntu-latest

environment:
name: testpypi
url: https://test.pypi.org/p/nasdaq-protocols

permissions:
id-token: write

steps:
- name: Download all the dists
uses: actions/download-artifact@v6
with:
name: build-artifacts-3.12
path: ./
- name: list all files
run: ls -lR
- name: Publish distribution 📦 to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/

publish-to-pypi:
name: >-
Publish Python 🐍 distribution 📦 to PyPI
if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes
needs:
- publish-to-testpypi # only publish to PyPI after TestPyPI publishing
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/nasdaq-protocols
permissions:
id-token: write
steps:
- name: Download all the dists
uses: actions/download-artifact@v6
with:
name: build-artifacts-3.12
path: ./
- name: list all files
run: ls -lR
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@release/v1