From 4c762d242b3535b3425178327e436c6f70bea1f1 Mon Sep 17 00:00:00 2001 From: Dominic Tarro Date: Sun, 14 Apr 2024 21:36:15 -0400 Subject: [PATCH] Split package and docs build and fix dependency install --- .github/workflows/publish-docs.yml | 36 ++++++++++++++++++ ...{build-publish.yml => publish-package.yml} | 37 ++----------------- 2 files changed, 40 insertions(+), 33 deletions(-) create mode 100644 .github/workflows/publish-docs.yml rename .github/workflows/{build-publish.yml => publish-package.yml} (54%) diff --git a/.github/workflows/publish-docs.yml b/.github/workflows/publish-docs.yml new file mode 100644 index 0000000..112aa8e --- /dev/null +++ b/.github/workflows/publish-docs.yml @@ -0,0 +1,36 @@ +name: Build & Publish Package + +on: + release: + types: [published] + workflow_dispatch: + +jobs: + build-and-publish-docs: + name: Build and publish docs + runs-on: ubuntu-latest + if: ${{ github.event.inputs.docs == 'true' }} + + steps: + - uses: actions/checkout@v3 + - name: Set up Python 3.10 + uses: actions/setup-python@v4 + with: + python-version: "3.10" + cache: pip + cache-dependency-path: requirements*.txt + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + python -m pip install -r requirements.txt + python -m pip install -r requirements-dev.txt + + - name: Build docs + run: mkdocs build + + - name: Publish docs + uses: JamesIves/github-pages-deploy-action@v4.4.2 + with: + branch: docs + folder: site diff --git a/.github/workflows/build-publish.yml b/.github/workflows/publish-package.yml similarity index 54% rename from .github/workflows/build-publish.yml rename to .github/workflows/publish-package.yml index 71857c1..c7d87c7 100644 --- a/.github/workflows/build-publish.yml +++ b/.github/workflows/publish-package.yml @@ -3,12 +3,6 @@ name: Build & Publish Package on: release: types: [published] - workflow_dispatch: - inputs: - docs: - description: 'Builds and publishes docs after building and publishing the package. Default is true.' - required: false - default: 'true' jobs: build-release: @@ -21,11 +15,14 @@ jobs: uses: actions/setup-python@v4 with: python-version: "3.10" + cache: pip + cache-dependency-path: requirements*.txt - name: Install packages run: | python -m pip install --upgrade pip build - python -m pip install --upgrade --upgrade-strategy eager -e ".[dev]" + python -m pip install -r requirements.txt + python -m pip install -r requirements-dev.txt - name: Build a binary wheel and a source tarball run: | @@ -55,29 +52,3 @@ jobs: with: password: ${{ secrets.PYPI_API_TOKEN }} verbose: true - - build-and-publish-docs: - name: Build and publish docs - runs-on: ubuntu-latest - if: ${{ github.event.inputs.docs == 'true' }} - - steps: - - uses: actions/checkout@v3 - - name: Set up Python 3.10 - uses: actions/setup-python@v4 - with: - python-version: "3.10" - cache: pip - cache-dependency-path: Pipfile - - - name: Install dependencies - run: | - python -m pip install --upgrade pip - python -m pip install --upgrade --upgrade-strategy eager -e ".[dev]" - mkdocs build - - - name: Publish docs - uses: JamesIves/github-pages-deploy-action@v4.4.2 - with: - branch: docs - folder: site