Skip to content

New Functions and Updated Documentation #52

New Functions and Updated Documentation

New Functions and Updated Documentation #52

Workflow file for this run

name: Upload Python Package
on:
workflow_dispatch:
release:
types: [published]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools build twine
# - name: Build and publish
# env:
# TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
# TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
# run: |
# python -m build
# twine upload dist/*
- name: Build package
run: python -m build
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}
build:
name: Deploy docs
runs-on: ubuntu-latest
steps:
- name: Checkout main
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Generate changelog
run: python3 scripts/changelog.py
- name: Build MkDocs site
run: mkdocs build
- name: Copy README to docs/index.md
run: cp README.md docs/index.md
- name: Copy CONTRIBUTING to docs/contribute.md
run: cp CONTRIBUTING.md docs/contribute.md
- name: Copy CHANGELOG to docs/release-notes.md
run: cp CHANGELOG.md docs/release-notes.md
- name: Configure git
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
- name: Stash changes
run: git stash --include-untracked
- name: Pull latest gh-pages
run: |
git fetch origin gh-pages
git checkout gh-pages
git pull origin gh-pages
git checkout -
- name: Apply stash
run: git stash pop
- name: Deploy to GitHub Pages
run: mkdocs gh-deploy --force
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}