From c717aa1a001bb1bba1b35ce49faabbb111846db8 Mon Sep 17 00:00:00 2001 From: grantbuster Date: Fri, 3 Nov 2023 12:28:40 -0600 Subject: [PATCH] added workflows --- .github/workflows/gh_pages.yml | 34 +++++++++++++++++++++++++++ .github/workflows/publish_to_pypi.yml | 26 ++++++++++++++++++++ .github/workflows/release_drafter.yml | 14 +++++++++++ 3 files changed, 74 insertions(+) create mode 100644 .github/workflows/gh_pages.yml create mode 100644 .github/workflows/publish_to_pypi.yml create mode 100644 .github/workflows/release_drafter.yml diff --git a/.github/workflows/gh_pages.yml b/.github/workflows/gh_pages.yml new file mode 100644 index 0000000..943428b --- /dev/null +++ b/.github/workflows/gh_pages.yml @@ -0,0 +1,34 @@ +name: Documentation + +on: + push: + branches: [main] + workflow_dispatch: + +jobs: + make-pages: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: select python version + uses: actions/setup-python@v2 + with: + python-version: 3.9 + - name: install dependencies + run: | + python -m pip install --upgrade pip + python -m pip install . + python -m pip install sphinx + python -m pip install sphinx_rtd_theme + python -m pip install sphinx-click + - name: build documentation + run: | + cd docs + make html + - name: deploy + uses: peaceiris/actions-gh-pages@v3.6.1 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./docs/_build/html + force_orphan: true + full_commit_message: ${{ github.event.head_commit.message }} diff --git a/.github/workflows/publish_to_pypi.yml b/.github/workflows/publish_to_pypi.yml new file mode 100644 index 0000000..9dc3e6f --- /dev/null +++ b/.github/workflows/publish_to_pypi.yml @@ -0,0 +1,26 @@ +name: Upload to PyPi + +on: + release: + types: [published] + workflow_dispatch: + +jobs: + deploy: + runs-on: ubuntu-latest + permissions: + # IMPORTANT: this permission is mandatory for trusted publishing + id-token: write + steps: + - uses: actions/checkout@v2 + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: 3.9 + - name: Install dependencies and Build + run: | + python -m pip install --upgrade pip + pip install setuptools wheel twine + python setup.py sdist bdist_wheel + - name: Publish + uses: pypa/gh-action-pypi-publish@release/v1 diff --git a/.github/workflows/release_drafter.yml b/.github/workflows/release_drafter.yml new file mode 100644 index 0000000..fab56e7 --- /dev/null +++ b/.github/workflows/release_drafter.yml @@ -0,0 +1,14 @@ +name: Release Drafter + +on: + push: + branches: [master, main] + +jobs: + update_release_draft: + runs-on: ubuntu-latest + steps: + - name: Release Drafter + uses: release-drafter/release-drafter@v5.15.0 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}